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.
Thanks!

Recommended Answers

All 4 Replies

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.

Try swapping out your cron line with the one I provided and see if that does the trick

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.