scripts based on time

Status
Not open for further replies.

eealking

New Member
Messages
7
Reaction score
0
Points
0
I am a newbie here, so hopefully I'm not asking an obvious question... anyway.

I would like to activate a php script at a specified time (6:00 PM) every day, so that it could update my database. I'm fairly sure I can not do this with straight php, so does x10 provide a handy tool to do this?

I think I can make a user activated script duplicate this behavior by having it detect how many times it should have run. But if there is an easier way, I'll take an extra large glass of that.

Since this is my first post here, thank you x10 for the server space, and thank you guys for the forum :biggrin:.
 

Christopher

Retired
Messages
14,659
Reaction score
8
Points
0
Create a cron and use this for the command
php -q /home/eealking/public_html/location/of/the/script.php

Set minutes to 0
Hour to 6pm
day to every day
month to every month
and weekday to every week day
 
Last edited:

eealking

New Member
Messages
7
Reaction score
0
Points
0
I've got a cron setup, it didnt run today, but I notice the server was having some trouble, and maybe it was off line when my script was supposed to run. It could also have been the lack of a shebang line. I didn't see a path for php, so I put in "#!/usr/local/bin/php" which I doubt is right >.>. I'll post back tomorrow with the results.

I put my script in my home directory rather than the public directory, could that be a problem? I don't want visitors to be able to activate the script.

Thanks :)
 
Last edited:

Jarryd

Community Advocate
Community Support
Messages
5,534
Reaction score
43
Points
48
Keep in mind the time you set the cron to is the server time, which is EST.
 

eealking

New Member
Messages
7
Reaction score
0
Points
0
Thanks guys, the script is running, (well, technically, its telling me I left a syntax error). :)
 
Status
Not open for further replies.
Top