Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Dec 2001
    Location
    Bodo, Norway
    Posts
    32

    Default Strange cron problem

    I have a server where I have set up a couple of accounts. Every time a cron script is run, it creates an empty file of the cron-file in the sites root folder (/home/***/)

    Example

    Let say that I run the following cron command:
    */15 * * * * wget http://www.mysite.com/cronjobs/cleanupscript.php > /dev/null 2>&1

    Every time this runs, a new, empty file, shows up in the site root, so now the site root looks like this;

    cleanupscript.php
    cleanupscript.php.1
    cleanupscript.php.2
    cleanupscript.php.3
    cleanupscript.php.4
    cleanupscript.php.5
    etc.

    Anybody seen this before and know what could be causing this to happen? The cron commands executes just fine, but I really don't want a bunch of empty files in all the root folders.

    thanks,

    T

  2. #2
    Member linux-image's Avatar
    Join Date
    Jun 2004
    Location
    India
    Posts
    1,185
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    what you are doing is downloading the cleanupscript.php from the said URL through wget. this is the reason why the files are populated inside the folder. Also, I do not think the real purpose of the script by the name is done using this wget command. If you want to execute the script at http://www.mysite.com/cronjobs/cleanupscript.php ; then you might want to first find the path to php with the command :

    which php

    from inside the server. This could be /usr/local/bin/php ; and then you can set the cron as

    /usr/local/bin/php /home/USERNAME/public_html/cronjobs/cleanupscript.php

    and there will be no further downloads and your script should execute fine. You may also use lynx; but the method above is teh best considering low apache usage as well.

Similar Threads & Tags
Similar threads

  1. Strange cpaddons notify email from cron?
    By serversphere in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-06-2006, 10:47 AM
  2. /etc/cron.daily/chkformmailver.cron Problem
    By Tig in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-06-2005, 03:07 PM
  3. very strange problem !
    By 4I1 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-06-2005, 03:01 PM
  4. Strange problem
    By wipl in forum New User Questions
    Replies: 2
    Last Post: 06-25-2004, 08:17 AM
  5. Strange Problem.. Can anyone help?
    By Diatone in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 07-04-2002, 06:31 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube