top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

Running a cronjob after every 5 min

0 votes
41 views

How do I execute certain shell script at a specific intervals in Linux using cron job?
Please provide examples using different time periods.

posted Mar 14, 2013 by Salil Agrawal

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

2 Answers

0 votes
 
Best answer

a)

Execute a cron job every 5 Minutes
*/5 * * * * <<Process>>

b)

Execute a cron job every 5 Hours
0 */5 * * * <<Process>>

c)

Execute a job every 5 Seconds
Cron job cannot be used to schedule a job in seconds interval. i.e You cannot schedule a cron job to run every 5 seconds. The alternative is to write a shell script that uses ‘sleep 5′ command in it.

d)

Execute a job every 5th weekday
0 0 * * 5 <<Process>>
(or)
0 0 * * Fri <<Process>>
Note: Get into the habit of using Fri instead of 5. Please note that the number starts with 0 (not with 1), and 0 is for Sun (not Mon).

e)

Execute a job every 5 months            
0 0 1 5,10 * <<Process>>
(or)
0 0 1 May,Oct * <<Process>>
answer Mar 14, 2013 by anonymous
0 votes

*/5 * * * * (Process name)

answer Mar 14, 2013 by anonymous
Similar Questions
+2 votes

In my linux system I want to start a cronjob but don't want to enter the enter the cronjob using 'crontab -e' rather want to enter without using 'crontab -e' may be via a script.

Any suggestion on how to achieve this?

+6 votes

I want to have two cronjob as per following routine.
1. First job I want to start at the start of every month.
2. Second job I want at every 4 hours.

Any suggestions

0 votes

One of our script need run on first Saturday every month. We have following setup on cron job but it run every Saturday.

15 04 1-7 * 6 /xxx/monthlybk.sh

Any one know how to fix it?


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.
QUERY HOME
...