Putting dependency among cron jobs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Putting dependency among cron jobs
# 1  
Old 10-26-2007
Putting dependency among cron jobs

Hallo All ,
Can we make the cron jobs dependent on previous job's status .
# 2  
Old 10-26-2007
You could put a wrapper around the script that

a) checks the previous exit_code in a file and does something

b) runs the original task

c) stores the exit code in a file
# 3  
Old 10-31-2007
Even I need to set up some dependency in the cron.
Can some one please help me in providing a sample code.

Thanks
Shash
# 4  
Old 10-31-2007
at job

Hi,
Sometime I used the at job to start jobs scheduled.
It is simple to start the next job with an other argument.

Simple create your script like you want.
And insert depending on thinks happed the start of the scheduled script
with other arguments or maybe one hour later!

This is the code you can insert inside your script:
/usr/bin/at now + 30 minutes < /export/home/start_the_script last_run_with_mistake 2> /export/home/log_data

The next time the script starts in 30 minutes with the attribute "last_run_with_mistake"

Be sure that you start the at job inside the start scripts to ensure that after a reboot the job start again.

I hope this can help you?

Best regards
joerg
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Cron jobs

I'm running cronjobs on a redhat 5.X. Cronjobs are getting failed frequently so how to find the root cause (2 Replies)
Discussion started by: karthik9358
2 Replies

2. Solaris

Cron jobs and at jobs

There are two jobs in Solaris , Cron and at jobs.. I know how to disable or enable cron jobs. How can I enable at jobs and disable it. Kindly help. Rj (2 Replies)
Discussion started by: jegaraman
2 Replies

3. Shell Programming and Scripting

Help with cron jobs

Hi Frenz, How do we get a cron job running in background to foreground ? (3 Replies)
Discussion started by: mkalase
3 Replies

4. Solaris

cron jobs

how to Put a cron entry which should be same script triggered on every Saturday and 1st of every month at 01.00 GMT. 0 2 1 * 6 --( At 2.00 GMT every sat & on 1st of every month) the above syntax is correct? Thanks (1 Reply)
Discussion started by: kurva
1 Replies

5. Linux

cron jobs

I created a php script. I'd like to have it run as a cron job every day at 10:30am. So i added 30 10 * * * /script.php to the cron file Is it possible to run the script on the command line to test it out ? (1 Reply)
Discussion started by: dannyd
1 Replies

6. Solaris

Cron Jobs

I'm trying to run cron jobs to start any inhibited processes after a system reboot. I can schedule th cron, but i'm confused as to how to incorporated the reboot, since reboot is scheduled at different times, once every month. How can I write this to start every 15 min after after a reboot ... (2 Replies)
Discussion started by: Remi
2 Replies

7. UNIX for Advanced & Expert Users

cron jobs

I need to monitor my cron jobs with another unix machine since occasionally the cron will go down on the main server but there are no errors. Can anyone help with a script to write to use the cron on the back up machine to monitor the main server? I am using SCO and the cron jobs have been... (3 Replies)
Discussion started by: rmarral
3 Replies

8. UNIX for Dummies Questions & Answers

cron jobs

I was wondering if itīs possible to cron job not to run on a certian day and time. Iīve got a job that runs everyday at 08:00 but would like it not to run on the 20:th between 08:00 and 10:00 Anyone know if this is possible, and if. How do i do it? regards... dOzY (3 Replies)
Discussion started by: dozy
3 Replies

9. Shell Programming and Scripting

cron jobs

hi folks, I need an explanation on cron jobs with an example (4 Replies)
Discussion started by: vijaysabari
4 Replies

10. UNIX for Dummies Questions & Answers

CRON Jobs

Hi, I am a total newbie to all things Unix. I've worked out I need to set up something that will allow me to automatically backup a DB for me, the DB is for a foum system I run. Now, I've only found out I need to use telnet for this, and worked out hwo to log into telnet today. From here... (4 Replies)
Discussion started by: eludlow
4 Replies
Login or Register to Ask a Question