So, I have 2-3 php scripts that I run as crons calling them using wget: /usr/bin/wget -o /dev/null http://example.com/cronrss.php
These files (cronrss.php) are getting copied in the example.com directory every time the cron runs, every new file having a new number (/home/example/cronrss.php1, ...cronrss.php2 etc)
So, what could be the reason for this strange behaviour?
I'm not very good with this but I guess the cronjobs are configured properly. They're running once per day, every middle of the night, at minute 0, then 5, then 10 etc.

7 Years
Discussion Span
Last Post by wattaman

wget is intended to download remote files via the command line, so what you're explaining is the expected behavior. The -o option is for logging output, where the -O option is for file output. If you're just wanting to download a file but throw all data away then use something like this:

wget -o /dev/null -O /dev/null - http://www.apexsoftware.com >> /dev/null 2>&1

I'm not sure I fully understood your instructions. I just want to run a simple php script. It works when opened in browser, it is removing some old database tables; is working as a cron, too, but I don't want the file copied all the time.
I used the -o /dev/null because I've read it should stop email being sent to owner, therefore save a little resources on the server's side. Am I wrong?
Thanks for trying to help.


Well, until you try you don't know :)
Your cron line work exactly like I wanted to, silently; no files are being copied now and no emails are being sent to user.
Thank you very much, Sknake!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.