Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a php script I want to run every minute to see if there are draft news posts that need to be posted. I was using "wget" for the cron command in cPanel, but i noticed (after a couple days) that this was creating a blank file in the main directory every single time it ran. Is there something I need to stop that from happening?


share|improve this question
if you don't get much traction here, try for this question. – Patrick R Feb 23 '10 at 23:31
what does the crontab in question look like? – Cory J Feb 23 '10 at 23:57
What's the name of the file? – mpez0 Feb 24 '10 at 0:43
up vote 5 down vote accepted

You need to send the output of that wget command to /dev/null if you want to avoid creating a file of the (blank) response from your php script.

Example in curl

curl -q http://your.server/script.php > /dev/null

Example in wget

wget -q -O /dev/null http://your.server/script.php

If you have the choice, you should use curl, that is a better tool for this job.

share|improve this answer
Differences between wget & curl – Dax Jan 18 '13 at 10:30

Without seeing your script, or the filename or the crontab entry it's hard to guess, but this is what I'd look at first. Try adding one or both of -o /dev/null and/or -O /dev/null to the parameters of your wget call. The first one sends stderr to the bit bucket and the second one sends the files that wget would download there. You can also use the -q switch to turn off other output. Your choice of these depends on how you're using wget.

share|improve this answer
wget --delete-after

is the key :-)

share|improve this answer
Ohh, nice. I didn't know that option, i'm a curl man myself. – Dave Cheney Mar 2 '10 at 5:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.