Run cronjob for every 10 minutes


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Run cronjob for every 10 minutes
# 1  
Old 05-31-2013
Run cronjob for every 10 minutes

Hi Friends,

I have a requirement to run the cronjob for every 10 minutes from 2:00 AM to 6:00 AM. Does the below code works? If not, please advise.

* * * * * command to be executed
┬ ┬ ┬ ┬ ┬
│ │ │ │ │
│ │ │ │ │
│ │ │ │ └---------------------------------- day of week (0 - 6) (0 is Sunday, or use names)
│ │ │ └------------------------------------ month (1 - 12)
│ │ └-------------------------------------- day of month (1 - 31)
│ └-----------------------------------------hour (0 - 23)
└-------------------------------------------min (0 - 59)

10,20,30,40,50 2-6 * * *

OR

*/10 2-6 * * *

Last edited by srikanthbiradar; 05-31-2013 at 01:25 AM..
# 2  
Old 05-31-2013
The first one is the standard way so should work on any cron implementation. The second one uses a non portable extension so is non portable. You'll need to check with your cron manual page.
This User Gave Thanks to jlliagre For This Post:
# 3  
Old 05-31-2013
Both seems to work, but
10,20,30,40,50 2-6 * * * does not run on the hour (2:00, 3:00 etc), adding 00 does not work 00,10,20,30,40,50 2-6 * * *

*/10 2-6 * * *
gives
Code:
2013-06-01 02:00:00
2013-06-01 02:10:00
2013-06-01 02:20:00
2013-06-01 02:30:00
2013-06-01 02:40:00
2013-06-01 02:50:00
2013-06-01 03:00:00
2013-06-01 03:10:00
2013-06-01 03:20:00
2013-06-01 03:30:00
2013-06-01 03:40:00
2013-06-01 03:50:00
2013-06-01 04:00:00
2013-06-01 04:10:00
2013-06-01 04:20:00
2013-06-01 04:30:00
2013-06-01 04:40:00
2013-06-01 04:50:00
2013-06-01 05:00:00
2013-06-01 05:10:00
2013-06-01 05:20:00
2013-06-01 05:30:00
2013-06-01 05:40:00
2013-06-01 05:50:00
2013-06-01 06:00:00
2013-06-01 06:10:00
2013-06-01 06:20:00
2013-06-01 06:30:00
2013-06-01 06:40:00
2013-06-01 06:50:00
2013-06-02 02:00:00
2013-06-02 02:10:00
etc

Test it yourself here:
CRON tester - Test your CRON definition
This User Gave Thanks to Jotne For This Post:
# 4  
Old 05-31-2013
Thanks guys.

It looks like I have bumped into another problem. Smilie
I just did a basic cron stuff(below) and the job didn't run. Do I need any permissions to run the cronjobs?? Because I am not legible to access the path /var/spool/cron/ -- says, permission denied SmilieSmilieSmilie

30 01 * * * (And the path of the script)

Reasons for the execution failure????

Note: - Job runs successfully via manual process.





Last edited by srikanthbiradar; 05-31-2013 at 04:15 AM..
# 5  
Old 05-31-2013
It would help if you tell what OS you are running.

Did you try 0,10,20,30,40,50 2-6 * * * ?
# 6  
Old 05-31-2013
It's not clear in your request: Do you want to run up to 6:00h only or to 6:50h
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron Job to Run every 2 minutes

Hello Gurus, I want to schedule a cron job which will run every 2 minutes starts at 11:25 AM and 3:25 AM daily. Can you please suggest as how to schedule the job. Thanks- Pokhraj Das (2 Replies)
Discussion started by: pokhraj_d
2 Replies

2. Shell Programming and Scripting

Cron Job to Run for 30 minutes

Hello Gurus, I have a requirement to run a job from cron only for 30 minutes duration daily twice at 8.35 am and 20.35 pm Can you please suggest how to schedule the job? Thanks- Pokhraj (5 Replies)
Discussion started by: pokhraj_d
5 Replies

3. Shell Programming and Scripting

Run a script continuously for 10 minutes

Hi all!! Im using ksh and my OS is Linux. I want to run a script for ten minutes, starting from my current system time. How to acheive this? Any help appreciated. Thanks in advance (5 Replies)
Discussion started by: Jayaraman
5 Replies

4. UNIX for Dummies Questions & Answers

Run the shell script for every 15 minutes?

I want to run my shell script for every 15 minutes starting from 12:20AM. I am passing parameter GA to shell script. Does this work? Any one please comment on this? 20 0-23/15 * * * xyz.sh 'GA' > xyz.log 2>&1 (9 Replies)
Discussion started by: govindts
9 Replies

5. AIX

My script didn't run every run every minute at cronjob

In my cronjob, I would like to schedule my script.sh to run every minutes. I crontab -e and have in line below but it didn't seems to run at all. * * * * * script.sh When I run it manually, I can run it. Is that anything wrong with the above line? If I change it to something like below,... (4 Replies)
Discussion started by: ngaisteve1
4 Replies

6. Shell Programming and Scripting

Doesn't run as a cronjob...

Hi! I have a svn backup script that works perfectly if I execute it from the command line but if I set it as a cronjob to run at night, only part of the code works. So, basically the scripts starts by deleting the folder yesterday and then moves the folder today to the folder yesterday. When... (4 Replies)
Discussion started by: ruben.rodrigues
4 Replies

7. Shell Programming and Scripting

How to schedule a cronjob to run every 15 mins ?

Hi, I want to schedule a job to run every 15 mins through cron. searched the forums and came up with this piece of code.i have given this in my crontab 0-59/15 * * * * sh /usr/ss/job But its not being run. Have i made any mistake here. Can any1 post the cron code for scheduling the... (5 Replies)
Discussion started by: suresh_kb211
5 Replies

8. Shell Programming and Scripting

Script to run every 5 minutes

Hello all, I want to run a script every 5 minutes. How to accomplish this task? Thanks in advance Mrudula (12 Replies)
Discussion started by: mrudula009
12 Replies

9. Solaris

Schedule to run every 3 minutes - CRONTAB

Hello all, I want to run a script every 3 minutes in os level and to send mail. I scheduled in crontab as 3 * * * * /mnt1/monitorscripts/testdbstart.sh I got mail every one hour and I confirmed that the script is running every 1 hour which doesn't meet my requirment. Where I am... (4 Replies)
Discussion started by: prashanth_gs
4 Replies

10. UNIX for Advanced & Expert Users

cannot run cronjob

I have the following cron: 0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /v/sysadmin/sysnet/file.pl The .pl has been tried at 755 and 777 The script works if manually run by the web browser or unix command prompt, but I can't get the Cron to do it automatically i went... (3 Replies)
Discussion started by: shahrahulb
3 Replies
Login or Register to Ask a Question