Crontab is creating sequentially numbered, emtpy files in my directory (file.1, file.2, file.3 etc.)

Question:

I have the following crontab:

* * * * * /usr/bin/wget http://mydomain.com/ow_cron/run.php > /dev/null

It works but it leaves files called run.0, run.1, run.2, etc. in my home directory. I added :

> /dev/null 2>&1

to the crontab but it still does it. How can I make it stop?

Answer

Add the option:

–delete-after

and the annoying sequentially numbered files should stop.

An example:

* * * * * /usr/bin/wget --delete-after http://mydomain.com/ow_cron/run.php > /dev/null

Leave a Reply

Your email address will not be published. Required fields are marked *