Cron creating sequental files in root director

apps

#1

Howdy,

I’ve installed Drupal 5.0, and per the instructions on the dreamhost wiki, I’ve setup a the following cron tab to run:

0 * * * * /usr/bin/wget http://www.mywebsite.org/cron.php

I created it a couple days ago, and seems to be working. But the issue is that every time it runs (every hour) it creates an empty file, named sequentally in the root direcory (that my domains are in):

cron.php
cron.php.1
cron.php.2
cron.php.3
cron.php.4
cron.php.5
cron.php.6
[etc., to infinity]

I’m recieving the following as an email from root@.myftpserver.dreamhost.com:

–15:00:04-- http://www.mysite.org/cron.php
=> `cron.php.56’
Resolving www.mysite.org… 208.113.160.130
Connecting to www.mysite.org[208.113.160.130]:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 0 [text/html]

0K 0.00 B/s

15:00:11 (0.00 B/s) - `cron.php.56’ saved [0/0]

I guess this is informing me of the file that was created… I don’t understand why it’s doing this?
what can I change in my cron file to stop this file being created if there is no error? Or is this the sign of an error, or is this normal?
Oh, yeah, I’m kind of a noob, but quickly learning drupal.


#2

I get those as well :slight_smile:

Every few weeks I SSH into the account and delete a few.

My crontab line has

0 2 * * * wget http://drupal.example.com/cron.php

So it just runs once. At the top of the crontab file I have MAILTO= because I want to receive the emails. They will tell you if there is a problem with the drupal system.

If you add >/dev/null 2>&1 to the end of the crontab then the error messages/emails will go into a black hole never to be seen again.

However you may just wish to adjust your crontab line.

Have a look at this page which may help if you have not read it already. (It has a link to setting up cron jobs on DreamHost, apparantly culled from the DreamHost knowledge base. :slight_smile: )


Norm

Opinions are my own views, not DreamHosts’.
I am NOT a DreamHost employee OK!! :@

You act on my advice at your own risk!


#3

Well you can add --delete-after to wget… and you will not get the files… as wget will delete after download and -q to avoid output (quiet mode)… so I think your cron must be some like…

0 * * * * /usr/bin/wget --delete-after -q http://www.mywebsite.org/cron.php


#4

Try:

wget -q -O /dev/null http://drupal.example.com/cron.php

This gets rid of the wget status output and throws away the data from the http request.