Link to home
Start Free TrialLog in
Avatar of XK8ER
XK8ERFlag for United States of America

asked on

setup conrjob for php

hello there,
I have a little php script that is ran every 5 minutes from cronjob..
I would like to know how can I make something so that its ran every 24 hours..

for example:
there is a log file that says "Finished at 12:13am" then when cron hits 12:15am it should run the script..
the php script usually takes 3 minutes to finish running so when its done it should write "Finished at 12:18am"..
im trying to make a cronjob that can run about 2 minutes after 24hrs..
I know how to setup the cronjob to run every 5 minutes I need help and ideas with the php code..
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

The cronjob sets the timing, not the PHP.
In crontab put

15 00 * * *  pathToJob

change "pathToJob" to the name of the script

will run at 12:15 am everyday


Cd&
Avatar of XK8ER

ASKER

you guys dont understand what im trying to accomplish..
Avatar of XK8ER

ASKER

if I run the php script at 12:15am and it finished at 12:18pm and then I run it at 12:15am the next day then its 23 hours and 57 minutes.. not 24 hours..
that why I need it to run at 12:15am then 12:20 the next day then 12:25 the next so on ..
Avatar of XK8ER

ASKER

**12:15am and it finished at 12:18am
Cron isn't going to do that for you.
Cron is not dynamic.  You tell it when and it does the job but it has to be a hard value there are no variables in cron.


Cd&
ASKER CERTIFIED SOLUTION
Avatar of xterm
xterm

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of XK8ER

ASKER

just amazing xterm!! glad to see useful coders here on EE.