LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-17-2009, 01:01 PM   #1
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,466
Blog Entries: 6

Rep: Reputation: 51
cronjob to run every 15 minutes?


Hello,

Can anyone help me setting up cronjob to run every 30 seconds.
Shall this entry help me:

Code:
*/2 * * * *
Pls suggest?
 
Old 11-17-2009, 01:05 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
http://en.wikipedia.org/wiki/Cron
 
Old 11-17-2009, 01:05 PM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

If I'm not mistaking the minimum time unit for cron is one minute, no less. The entry you posted means every two minutes (dividable by 2). If you put only the * it will run every minute.

Kind regards,

Eric
 
Old 11-17-2009, 01:08 PM   #4
indiajoe
Member
 
Registered: Jan 2009
Location: India
Distribution: Porteus atma
Posts: 84

Rep: Reputation: 21
Hi
I don't think you can run crontab in an interval less than 1 minute.
But if you want to do it in 30 second, just make that in the script you are calling.
To run crontab in every 15 mins, following line will do
Code:
*/15 * * * * Command
Just google for crontab examples.
-Cheers
indiajoe

Last edited by indiajoe; 11-17-2009 at 01:10 PM.
 
Old 11-17-2009, 05:14 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,349

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Can you clarify whether you mean every 15 mins or every 30 seconds?
The minimum time accuracy in cron is 1 minute.
It's inefficient to go that low for frequency though, as cron has to instantiate a whole new process environment every time.
My rule of thumb is that for anything more frequent than every 5 mins, just write a daemon that sleeps as long as required at the start of each iteration. Much more efficient.
 
Old 11-19-2009, 10:58 PM   #6
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,466

Original Poster
Blog Entries: 6

Rep: Reputation: 51
Sorry for the late response.
I want to run every 30 seconds.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i get a cronjob to run every two hours in AIX: 00 */2 * * * command no work boyd98 AIX 1 10-19-2009 06:33 PM
[SOLVED] make cronjob run every 10mins qwertyjjj Linux - Newbie 2 08-13-2009 08:06 PM
only run cronjob when asteriks voip gives 0 on channels 1c3c0ld Programming 1 10-08-2008 07:07 PM
strange cronjob / mail every 20 minutes jon23d Ubuntu 1 10-16-2006 08:15 AM
why do these cronjob not run? SheldonPlankton Linux - General 1 01-05-2005 08:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration