Let me clarify. I want a job to run every fifteen minutes. So, it will run on 0, 15, 30, and 45 of each hour. How do I do this? I know how to get seconds and minutes and hours and all that. But how do your calculated that fifteen minutes or say 5 minutes have passed?
Ok, this is what I did I used the function modulus.
if [ `expr $MIN % 15` = 0 ] # this determins if there is
# a remainder.
then
succcess
else
fail
fi
By determining the remainder I can tell whether the minutes are a multiple of 15 or not. So, 30 will return a 0 and so on. I hope this helps someone else.
Listen to the responses! This kind of thing is done with cron. You just need to create a script to do what you want one time with no time logic built into it. Then put an entry in your crintab like this...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.