Need some Help with cron jobs

Status
Not open for further replies.

tstmesi

New Member
Messages
3
Reaction score
0
Points
1
i'm pretty new to cron jobs, so it might be just the fact that this may not be allowed. but what i'm trying to do is have a PHP script to update user rankings in a mysql DB, every 15minutes, I'm using Cpannel, and the information on x10 wiki about cron jobs but those seem to be all command line or i might be misunderstanding it. I'm also trying to keep these out of my public_html folder.

my current cron job command looks like this

Untitled.png

i have also tried these commands


/usr/local/bin/php -f /home/tstmesi/jobs/cron_rankings.php
/usr/local/bin/php -q /home/tstmesi/jobs/cron_rankings.php

/usr/local/bin/php $HOME/tstmesi/jobs/cron_rankings.php
/usr/local/bin/php -f $HOME/tstmesi/jobs/cron_rankings.php
/usr/local/bin/php -q $HOME/tstmesi/jobs/cron_rankings.php
 

tstmesi

New Member
Messages
3
Reaction score
0
Points
1
thanks for the reply, gona give it a go and see what it comes up with, i was unaware i had to put #!/usr/local/bin/php, in my php file thank you for this information also
 

tstmesi

New Member
Messages
3
Reaction score
0
Points
1
I did get them working, but i had to move the files back to public_html, but i understand there is a way to set permission for the file itself to only be accessed by the server,
the line i used

/usr/local/bin/php /home/tstmesi/public_html/cron_rankings.php

on another note i have a php file that also updates how much gold players get every 30min, it is also working but i did not add

#!/usr/local/bin/php

at the beginning of the file should i be worried about this?
 

pus

New Member
Messages
9
Reaction score
0
Points
1
If you don’t know how to setup cronjob, a third party webcron like easycron may be a good option for you.
 
Status
Not open for further replies.
Top