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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to define time when using crontab -e

Status
Not open for further replies.

horse123

Technical User
Oct 13, 2003
17
0
0
AU
Hi All,

I would like to automatically execute a process every two hours with crontab. Initailly I defined it as:
120 7-20 * * * /sirsi/john/program_script_2
which has error "time bound"

so I changed it to:
59 7-20 * * * /sirsi/john/program_script_2

But I really want to process it every two hours.

Currently I have two entries in crontab doing different things:
2 7-22 * * * /sirsi/john/Program_script_1
59 7-20 * * * /sirsi/john/program_script_2

Also will these two entries be conflicting with each other?
Please help me, thanks in advance
John
 
Hi,

crontab first and second entry columns are : minutes hours
Code:
00 00,02,04,06,08,10,12,14,16,18,20,22 * * * /sirsi/john/program_script_2 1>/dev/null 2>&1
# or 
00 01,03,05,07,09,11,13,15,17,19,21,23 * * * /sirsi/john/program_script_2 1>/dev/null 2>&1

Redirectin "1>/dev/null 2>&1" if you dont want to be mailed every time the script is executed




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top