Cron creating sequental files in root director

Cron creating sequental files in root director

Posted by: barrya
Posted on: 2007-02-02 15:57:00

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.




Re: Cron creating sequental files in root director

Posted by: norm1037
Posted on: 2007-02-02 16:28:00

I get those as well 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=<username> 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. smile)

http://drupal.org/cron




--
Norm


Opinions are my own views, not DreamHosts'.
I am NOT a DreamHost employee OK!! mad

You act on my advice at your own risk!

Re: Cron creating sequental files in root director

Posted by: ardco
Posted on: 2007-02-02 19:43:00

Maybe you should try something like:

0 * * * * /usr/bin/wget http://www.mywebsite.org/cron.php > /dev/null 2>>cron-errors.txt

In theory (untested) correct functioning messages (like in your emails) will go to the bit bucket, and errors if any will get added to one file.

Wget and cron are working for you as designed, btw.

Re: Cron creating sequental files in root director

Posted by: vicm3
Posted on: 2007-02-02 20:20:00

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



Re: Cron creating sequental files in root director

Posted by: ardco
Posted on: 2007-02-02 20:23:00

That's probably better than my suggestion, which would still collect the files, although won't yours still send the emails?

Re: Cron creating sequental files in root director

Posted by: lrosenstein
Posted on: 2007-02-05 16:55:00

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.



Tags: php crondreamhostemailmysitemywebsitedrupalwikiwgetusr binphp 3php 5couple daysrecievinghowdyphp 4tab