Running a PHP Script from a Cronjob

3 posts / 0 new
Last post
#1 Wed, 09/19/2012 - 10:25
MTUser2012

Running a PHP Script from a Cronjob

I've googled this with Virtualmin as a keyword and read all the answers that I can find. I am hoping for some specific advice here as I have a specific problem that I can't solve from what I found on Google.

I need to run this script "/home/bbcurve/public_html/c/getcities.php" every two hours. Before I knew any better, I just listed it in Virtualmin GUI as shown in the attachment. I soon learned that this isn't directly possible on my Centos VPS.

I've figured out the correct way to run this job from the command line is:

crontab -e, put "i"
* */2 * * * /usr/bin/php /home/bbcurve/public_html/c/getcities.php :x -> Esc

Please can I get some help on how to translate this into what I put into the boxes in the Virtualmin Gui?

Thanks.

Wed, 09/19/2012 - 10:26
MTUser2012

Here is the attachment that I don't seem to be able to attach to the first post

Wed, 09/19/2012 - 15:51
andreychek

Howdy,

Although I wouldn't recommend running it as root, I'd suggest using the Virtual Server owner -- the rest of that looks good.

Are you having a problem of some sort, executing that PHP script?

If you are having some sort of problem -- what happens if you run that PHP script manually from the command line, does that work without any errors?

-Eric

Topic locked