cancel
Showing results for 
Search instead for 
Did you mean: 

crontab help

 
rajesh73
Super Advisor

crontab help

i want to run this command in every 2 minites, please find the below command is right or wrong

 

2 * * * * /home/rajesh/data.txt

 

the above script is not executed

3 REPLIES
Patrick Wallek
Honored Contributor

Re: crontab help

>> 2 * * * * /home/rajesh/data.txt

 

No, that will only run it 2 minutes after each hour (8:02, 9:02, 10:02, etc).  If you want it to run every 2 minutes you must specify all the minutes you want it to run.  In HP-UX that would be like:

 

0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * /home/rajesh/data.txt

 

 

rajesh73
Super Advisor

Re: crontab help

thanks for your quick reply
Dennis Handly
Acclaimed Contributor

Re: crontab help

Instead of running every two minutes, you might want to sleep in between iterations.