Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Every 45Minutes

Status
Not open for further replies.

kozlow

MIS
Mar 3, 2003
326
US
Any ideas on how to run a crontab job every 45Minutes?
 
do a crontab -e

45 * * * * /usr/bin/whatever >/dev/null 2>&1

Thats minutes hours dayofmonth month weekday command
 
Two ways spring to mind.

1) Seperate crontab entries

00 01
45 01
30 02
15 03
00 04
45 04
30 05

2) Script if counter = 3 run script, then run every 15 minutes from cron

00,15,30,45 *

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Just for completeness

Code:
#!/bin/ksh

while :
do
  nohup /path/to/script/to/run &
  sleep 2700
done
but this method does tend to suffer from creep, the time to run the background process is non-zero so the loop takes a little over 45 mins - so don't set your watch by it!

Ceci n'est pas une signature
Columb Healy
 
I am going to make my life easy and run every 40Minutes:

Even Hours - 00,40
Odd Hours - 20

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top