1

My cron job, command looks similar to this:

wget -q http://whatever-url/

It is running correctly (every minute). Problem is that it is creating empty php files at my root for every minute it runs. I'm not familiar with cron job commands. Is there a cron command that keeps this from happening, but will not alter the way script runs?

1
  • How did you add the new cron job and how exactly does it look? Nov 13, 2013 at 15:21

1 Answer 1

4

So tell wget not to output.

wget -qO /dev/null http://whatever-url/
5
  • The OP said: "Problem is that it is creating empty php files" Nov 13, 2013 at 16:28
  • @RaduRădeanu Yeah, I'm assuming a Wordpress behind-the-scenes script (per the URL that I've just edited out because it looked spammy) wouldn't need to output that much so that would leave an empty .php file. That's fairly common when you're writing a script that's only purpose is to be called from cron.
    – Oli
    Nov 13, 2013 at 16:30
  • so basically i shouldn't set cron to run "all" (per minute) when i only want to run something once every 12 or 24 hours or so. i basically am just following the 'instructions' of the product.
    – alx
    Nov 13, 2013 at 16:47
  • @alx That's not what I'm saying at all. I'm saying that if you're making requests to a file that you don't want to download, you should tell wget to not save the output. The default is to save and that's why you've got files popping up.
    – Oli
    Nov 13, 2013 at 16:51
  • thanx for responding - oh okay, so the wget -qO will do that. (incidentally, that's an alpha "O" right? not zero) at first, the command line looks like it is just to disable completely. so it is to disable 'saving' of output. yes? sorry if i sound like a dufus, i don't know cron at all, i can draw with crayons and know a little html and php is about it for me.
    – alx
    Nov 13, 2013 at 16:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .