XK8ER
asked on
run cronjob
hello there,
I would like to setup a cronjob to run every day every 24 hours but with a twist..
if it possible to run lets say today at 1:00pm then tomorrow at 1:01 then the next day 1:02 etc..
each day and extra minute.. is this possible?
I would like to setup a cronjob to run every day every 24 hours but with a twist..
if it possible to run lets say today at 1:00pm then tomorrow at 1:01 then the next day 1:02 etc..
each day and extra minute.. is this possible?
You could start a shell script at 1pm every day and have the shell script write a log file to a folder.
Then for each log file it finds in the folder do a "sleep 60" command:
#! /bin/sh
for i in /logfolderdirectory
do
sleep 60
done
The shell script could then go on to do whatever task you want it to do.
Then for each log file it finds in the folder do a "sleep 60" command:
#! /bin/sh
for i in /logfolderdirectory
do
sleep 60
done
The shell script could then go on to do whatever task you want it to do.
I should have said - obviously the log files would have to have unique names - something like:
myshellscript > logfile.`date +%y%m%d`
so the logfile's name would have the day's date in yymmdd format appended to it.
myshellscript > logfile.`date +%y%m%d`
so the logfile's name would have the day's date in yymmdd format appended to it.
ASKER
I am trying to run a php script.. and for example it takes about 30 seconds to finish running..
so I need to run it exactly 24 hours after finishing.. so if I run it every 24hrs its 30 seconds too early..
so I need to run it exactly 24 hours after finishing.. so if I run it every 24hrs its 30 seconds too early..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
may I ask why you need such a scheduling?
and also, will it "reset" to 1pm at some time? for example, when it reached 2pm or so?
or once per month reset to 1pm?
please clarify