how can I reschedule a job if it fails


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how can I reschedule a job if it fails
# 1  
Old 01-22-2009
how can I reschedule a job if it fails

i have a sql script ex a.sql
i want to schudle it at 1 am every day
if it fails then it wiil run after 2 haours
can some one help me write a shell script for this problem???????????
# 2  
Old 01-22-2009
Quote:
Originally Posted by alokjyotibal
i have a sql script ex a.sql
i want to schudle it at 1 am every day
if it fails then it wiil run after 2 haours
can some one help me write a shell script for this problem???????????

In your crontab file:

Code:
0 13 * * * runsql

Code:
## NAME: runsql
until a.sql
do
 sleep 120
done

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job fails with [DataDirect][ODBC lib] Connection not open error

Hi, When run the script directly...it executes as expected. But when put it in crontab the job fails with this error: Connection not open 08003: Connection not open Unable to connect to the database... how come it is not able to connect when cron job fires?... Do I need to... (7 Replies)
Discussion started by: nuthakki
7 Replies

2. UNIX for Advanced & Expert Users

Cron job fails every now and then.

I added a shell script to cron that executes every 5-15 minutes. It's used to monitor multiple environments, so it has to ssh to each machine to check the status of that machine. Sometimes, I may have more than one instance of this script running at the same time. So, here's my problem. I've... (2 Replies)
Discussion started by: mrwatkin
2 Replies

3. Shell Programming and Scripting

autosys job configuration for job failure.

We need to configure autosys that when a job fails continously for 3 times, we need to call another job. Is this possible in Autosys, or can anyone advice on the alternative. (2 Replies)
Discussion started by: sangea
2 Replies

4. Shell Programming and Scripting

Script to Start a Job after finding the Old job completed

Hi Experts, I need a script advice to schedule 12 jobs ( SAS Codes execute back ground ). Algorithem: 1. Script checks first job. 2. Finds first job is done; invoke second job. 3. finds second job is done; invoke third job. .. Request you to please assist. (3 Replies)
Discussion started by: Jerald Nathan
3 Replies

5. UNIX for Dummies Questions & Answers

If FTP cron job fails to connect = quit

Im having a problem with my ftp CRON jobs. I have another related (but not the same question in shell scripting). My FTP CRON jobs connect to a server and drop some files off, if for some reason it cannot connect to the server (timesout/password wrong etc) instead of stopping, it tries again... (3 Replies)
Discussion started by: mokachoka
3 Replies

6. UNIX for Dummies Questions & Answers

Script ran by job scheduler fails from the 15th to the 20th of the month

Hi, I have a script that finds the application logs from the previous day and sends it to another server via ftp. The code is something like this: yest_date=`TZ=CST+24 date "+%b %d"` logdir=/app/logs logs=app*.log tmpdir=/tmp cd $logdir for i in `ls -1 $logs` do chkstr=`ls -1l $i | grep... (2 Replies)
Discussion started by: tatchel
2 Replies

7. Shell Programming and Scripting

Cron job fails, but works fine from command line

I have a very basic script that essentially sends a log file, via FTP, to a backup server. My cron entry to run this every night is: 55 23 * * * /usr/bin/archive_logs The script runs perfectly when executed manually, and actually worked via cron for about three weeks. However, it mysteriously... (3 Replies)
Discussion started by: cdunavent
3 Replies

8. UNIX for Dummies Questions & Answers

How to insert child job under a box job?

I have this box job and it contains only one job under it which is to load a file. I want to insert a "File Watcher", "Copy File" to it? Have no clue how to do that...any help plzzz... (4 Replies)
Discussion started by: xejatt
4 Replies

9. Solaris

killing a unix job after the job process gets completed

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. Thanks... (7 Replies)
Discussion started by: dtazv
7 Replies

10. Shell Programming and Scripting

killing unix job after the job process completes

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. ... (1 Reply)
Discussion started by: dtazv
1 Replies
Login or Register to Ask a Question