Crontab Rescheduling


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Crontab Rescheduling
# 1  
Old 01-18-2010
Crontab Rescheduling

Hi,

I want to weekly schedule a script execution (using crontab) but only if the system load is low. My question is: If the script does not be executed ( because of high load ) how can I re-schedule the cronjob to run after some minutes? I want the re-scheduling to be executed until the final execution of my script.
# 2  
Old 01-18-2010
one way;
you can create a wrapper script, put your logic and call the main script based on the condition required, and schedule in cron.
# 3  
Old 01-18-2010
You could write 3 Cronjobs. 1 that checks if there is high load and writes a flag file for it, where the name or content of that flag file signals if load is high or low.
The other two scripts are one for the weekly runs, the other interval. Both scripts check what kind of flag file is set and if not, then it doesn't run.
# 4  
Old 01-18-2010
Or put a little 'while' or 'until' loop with a sleep at the beginning of the script to wait until the system load is low enough.
# 5  
Old 01-19-2010
Put a script in cronjob so it is invoked according to your schedule.
Add your logic to check the load, if high load then schedule the script to run say after 5 mins using at and exit. If load is normal/low execute the script.
your script should be like:
Code:
 
checkload
if load is high then
  at  <--- call self in background 
  exit.
else
  execute your code.

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Crontab

Hello, I have a situation with crontab command on AIX , when i run a script with crontab i receive empty output , when i run it manually i have information in it,beside the empty output ,SAS log is empty too, i don't know why isn't creating it , could someone told me how could verify crontab... (3 Replies)
Discussion started by: rimob
3 Replies

2. UNIX for Dummies Questions & Answers

Crontab Rescheduling

Hi, I want to weekly schedule a script execution (using crontab) but only if the system load is low. My question is: If the script does not be executed ( because of high load ) how can I re-schedule the cronjob to run after some minutes? I want the re-scheduling to be executed until the final... (1 Reply)
Discussion started by: tdakanalis
1 Replies

3. UNIX for Advanced & Expert Users

Crontab Rescheduling

Hi, I want to weekly schedule a script execution (using crontab) but only if the system load is low. My question is: If the script does not be executed ( because of high load ) how can I re-schedule the cronjob to run after some minutes? I want the re-scheduling to be executed until the final... (1 Reply)
Discussion started by: tdakanalis
1 Replies

4. UNIX for Dummies Questions & Answers

Crontab

That should echo Machine name and then the hostnames command into the test file every minute shouldnt it? Cant seem to get it working. (4 Replies)
Discussion started by: RAFC_99
4 Replies

5. Shell Programming and Scripting

Crontab help

Hi Guys, This is a line in my crontab. 07 15 24 11 6 /usr/local/dsadm/dsprod/src/run_ipoval.sh 2>&1 I understood as the script is to run on 24 of nov at 3 07 pm. But the script is running on every sat at 03 07 pm. could anyone help me out with this and clarify my doubt?? ... (4 Replies)
Discussion started by: mac4rfree
4 Replies

6. Shell Programming and Scripting

Rescheduling perl script using at command

Hi, I have a perl script which accepts a file as input and ftp the file to a particular sever.I scehduled this script at a specific time using crontab.Everything seeems fine if the input file is available under the path. Now assume due to some reasons the input file is not avaialble by... (6 Replies)
Discussion started by: DILEEP410
6 Replies

7. Shell Programming and Scripting

Help me with crontab

Hi, I am working with oracle, and want to make a scheduler program by using cron job.. I've done with shell script that calls oracle stored procedure. It works. However, when I call the script through crontab, it is failed. :( Here is the error message: Cron: The previous message... (2 Replies)
Discussion started by: rmard
2 Replies

8. UNIX for Advanced & Expert Users

Crontab

Hai , the working the path and representation of crontab application will differs from flavour to flavour in linux if so will any one plz tell me how it differs . its urgent :confused: Regards Sanju (1 Reply)
Discussion started by: sanjustudy
1 Replies

9. UNIX for Dummies Questions & Answers

crontab help

Hi All, Please help me in understanding the crontab entries and also below queries 1. how can we set a crontab entry 2. from where the cronjob will run( if default) 3. you can we specify the location from which the cronjob should run. 4. how can we capture the output of the cronjob. ... (8 Replies)
Discussion started by: thaduka
8 Replies

10. UNIX for Dummies Questions & Answers

crontab

Hi I have a shell script which works fine at the command line and does works in crontab also but does not send the output to mail as other scripts do by default. 10 1 * * * /export/home/test/report_script by default should send the output to mail but the script runs OK and the output... (1 Reply)
Discussion started by: run_time_error
1 Replies
Login or Register to Ask a Question