[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] setting up a cronjob for running a php file



> > What I do to run a php script through cron is to actually do a wget on
the
> > script. So I would change your command to:
> > "wget http://www.domain.com/netstatus/cron_script/cron_script.php
> > >/dev/null"
>
> I tried your suggestion however it works the result is a saved php file no
> matter the redirection to /dev/null

I don't think you can stop wget from saving the file. The redirection to
null is much more so that the status information that wget sends to the
terminal is not being generated and therefore you should not get an email
every five minutes.

If you don't want the file just do an rm cron_script.php straight after. I
have the command for cron like this:
"cd; wget http://www.domain.com/netstatus/cron_script/cron_script.php; rm
cron_script.php*"

(First change directory into the home directory of the user of the crontab
entry; Do the wget (I actually don't redirect to /dev/null as I want to get
an email (my script only runs 3 times a day)); last get rid of the file wget
produced)

Hope this helps

Cheers
Mark