0

I'm using cron tasks every 3 mins, the result is logged in my cron.log. Also after executing (wget) certain php file, it's name (with 0 bytes filesize) is copied to root, spaming it - see the figure

How can I prevent cron from filling up my root partition on Debian?

here is a spam screen - Spam Screen

My cron task is /usr/bin/wget http://mydomain.com/myphpscript.php >/dev/null 2>&1

voretaq7
  • 79,879
  • 17
  • 130
  • 214
dr_darwin
  • 1
  • 1
  • If one of the answers solved your problem, you should mark the answers as correct. This makes the question disappear from open questions. Otherwise please update. – Jonathan Feb 15 '12 at 10:38

2 Answers2

1

If you want to throw away the output of the script, tell wget to throw it away with -O /dev/null

using wget in cron to hit a php page begs the question of whether you couldn't just be running the php page with the php cli by installing the php5-cli package and running php /path/to/phpscript.php Is this really a script that needs to be accessible form both the web and from cron?

stew
  • 9,388
  • 1
  • 30
  • 43
0

Use -o /dev/null and -O /dev/null to throw away both the download and the output of wget.

Running it from shell as stew suggested seems better. After editing you could just run the same shell script.

It allso seems that you run your script as root. It is better to not run such scripts as root if possible.

Jonathan
  • 575
  • 1
  • 7
  • 18