Cron Jobs

stuffradio

New Member
Messages
38
Reaction score
0
Points
0
Hey, I'm making a php game. This game requires cron jobs which at certain times I want it to do a certain thing, how do I use the cron job in cPanel to run the script at 12 am every day or something like that?

So example I want it to run a reset.php script at 12 am every day, this would update stuff in the database. the part I'm confused on is the command, seeing how I have never set up a cron job before, I only know what they do :p, thanks for your help ahead of time.
 

bigguy

Retired
Messages
10,984
Reaction score
10
Points
38
You know, I think Richard is the one to talk to about this. Somebody else might know to, maybe Tyler. I have never used cronjobs. I would think the command would be the file you are trying to run wouldn`t it ??
 

Richard

Active Member
Messages
2,028
Reaction score
0
Points
36
This is a simple thing to do. So here is how.

First click on the Cron Jobs icon
Then press the Standard button
you will see box with Command to run:
in there type:
/usr/bin/wget -o /dev/null -O /dev/null http://path/to/your.file.php
Then under hours select 0 = 12am/Midnight
Now press save crontab

Now every day at 12am EST it will run
 

stuffradio

New Member
Messages
38
Reaction score
0
Points
0
wierd I tried doing exactly what you said, but I got an email saying this
"/bin/sh: line 1: /usr/bin/wget: Permission denied"
What did I do wrong? I really appreciate your help :)
 

Richard

Active Member
Messages
2,028
Reaction score
0
Points
36
You didn't do anything the permiissions on the server are not set to use that program. I'll look in to it.
 

n4tec

Active Member
Messages
3,312
Reaction score
0
Points
36
i am just wondering should Cron Jobs be done on shared servers...

*4*
 

Richard

Active Member
Messages
2,028
Reaction score
0
Points
36
Ok its working now.
i am just wondering should Cron Jobs be done on shared servers...
I don't see the problem, however if anyone tries to run a job every minute they will find their site suspended.
 

Killa619

New Member
Messages
43
Reaction score
0
Points
0
ok i tried what you all said above and it still did not work.
any ideas?
 

TPI007

New Member
Messages
533
Reaction score
0
Points
0
sorry to but in, i just wanna say interesting topic. I'm a noobie web guy and i'm just learning and looking around for useful information regarding php stuff. Cause I have a forum up and I want to upgrade it and make it better. I'm also building a clan Mod site soon for the game Crysis and i'm just looking for some ideas.
 
Last edited:
Top