Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 2 of 2

This is a discussion on What's wrong to my cronjob? in the Shared & Semi-Dedicated forum
Hi, I have to run every hour the maintenance script of phpadsnew, so I've added this cronjob: 50 * * * * wget http://www.zenigata.it/path_to_phpad...aintenance.php > ...

  1. #1
    JPC Senior Member Zenigata's Avatar
    Join Date
    Jan 2005
    Location
    Italy
    Posts
    71

    What's wrong to my cronjob?

    Hi,
    I have to run every hour the maintenance script of phpadsnew, so I've added this cronjob:


    50 * * * * wget http://www.zenigata.it/path_to_phpad...aintenance.php > /dev/null

    but now the root of my account is plenty of maintenance.php like this:

    maintenance.php.1
    maintenance.php.2
    maintenance.php.3
    ...

    This is an example of the cron output I received via email:

    --04:50:03-- http://www.zenigata.it/path_to_phpad...aintenance.php
    => `maintenance.php.63'
    Resolving www.zenigata.it... 69.73.175.125
    Connecting to www.zenigata.it[69.73.175.125]:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [text/html]

    0K 0.00 B/s

    04:50:10 (0.00 B/s) - `maintenance.php.63' saved [0]

    Please note phpadsnew manual says:

    # if your server supports curl:
    0 * * * * curl -s -o /dev/null http://your.server.name.here/phpAdsN...aintenance.php
    # if your server supports fetch:
    0 * * * * fetch -o /dev/null http://your.server.name.here/phpAdsN...aintenance.php
    # if your server supports lynx:
    0 * * * * lynx > /dev/null -dump http://your.server.name.here/phpAdsN...aintenance.php
    # if your server supports wget:
    0 * * * * wget -q -O /dev/null http://your.server.name.here/phpAdsN...aintenance.php
    What's wrong in my cron?

    Thanks
    Last edited by Zenigata; 10-06-2005 at 05:03 AM.

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    You aren't using the flags that the manual recommends. Note the differences:

    Manual: wget -q -O /dev/null url
    Your Example: wget url > /dev/null

    See the difference?

    In the manual example, the -q option means quiet. This turns off the output that is beign returned in the email you're receiving. The second option, "-O /dev/null," is telling wget to save the output to /dev/null instead of to files in your account. /dev/null is a black hole: sending out put there is the same as deleting it, so doing this will put an end to the maintenance.php.* files.

    wget was designed to copy entire sites in order to create mirrors, so rather than grabbing content and outputting it to a screen like most utilities do, wget copies files from a remote machine to the local one by default. This is why simply redirecting output to /dev/null (the "> /dev/null" in your command) isn't workig for you.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •