LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-29-2007, 06:46 AM   #1
champak
LQ Newbie
 
Registered: Nov 2007
Posts: 20

Rep: Reputation: 0
Cron Jobs Scheduling


Hi ,
Im supposed to run two cron jobs ..job1 and job2
The two should execute mutually exclusive...meaning like I dont want "job1" to be executing when "job2" is executing..
The jobs will terminate by themselves if the the other is already executing..

If we schedule these jobs in cron to execute for every 5 mins, one of the jobs never run at all..Because in 5 mins both jobs will start at once...The 2nd in the list will never run at all...

I want the jobs to execute in 5 mins interval..

How this can be done?

Any ideas?

Thanks..
 
Old 11-29-2007, 07:07 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

Why not just let job1 finish before starting job2?

*/5 * * * * job1.sh && job2.sh

The && means only start job2 if job1 didn't return an error code. If you want it to start anyway, use a ; instead.
 
Old 11-30-2007, 01:01 AM   #3
champak
LQ Newbie
 
Registered: Nov 2007
Posts: 20

Original Poster
Rep: Reputation: 0
Ya.THanks Guttorm
 
  


Reply



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
cron hourly, daily, cron.d jobs don't execute eggsmartha Linux - General 3 09-17-2007 06:37 PM
LXer: Scheduling Backup Jobs using at and crontab LXer Syndicated Linux News 0 04-22-2006 01:24 AM
scheduling jobs javier_ccs Linux - Newbie 4 01-09-2006 09:14 AM
Scheduling jobs Netmaster0000 Linux - Newbie 3 12-13-2003 06:43 AM
Problems scheduling jobs with cron ferrantepunto Linux - General 5 01-24-2003 07:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:43 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