restart logic in a script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting restart logic in a script
# 1  
Old 10-13-2009
restart logic in a script

Hi
I have a script as follows

Code:
Function func0
<Set of validations done>
Function Func1
<Set of commands and some of the variables set>
Function Func2
<Set of commands and some of the varibales set>
Function Func3
<Call a job(It is a datastage job which is called>

Main job
Call func0
Call Func1
Call Func3 <parameter 1>
Call Func2
Call func3 <parameter 2>

I want to implement restart logic in this script..If the script aborts at
"Call Func3 <parameter 1>" then it should start at the same place.

Also I dont want to call all the previous functions called, i want to store them in a separate file.

Any ideas how this can be done?
# 2  
Old 10-13-2009
loop the function, if your function doesn't succeed the way you want. exit with the appropriate exit code, then restart the loop. Id give a code example but I dont know what language you are using.
# 3  
Old 10-14-2009
Hi, thanks for your response, can you send me a sample script.

I am just using the shell script(ksh) no other language.
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Restart logic in script

I have a question regarding the restart logic in scripts. I have a script named "JOB1" which has 5 steps and every step has a program. Suppose my script fails at 4th step and the first 3 steps have completed successfully. I want to start my script from 4th step directly without doing any change... (1 Reply)
Discussion started by: champ2108
1 Replies

2. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

3. Shell Programming and Scripting

Restart Logic for a Korn Shell Master Script

Hello All, I was wondering if someone can help me to develop restart logic for a Korn Shell program (a master script) that I am developing. The program is design to invoke a series of child processes (Korn Shell Scripts) whose function is to create a series of load files on a specified mount... (0 Replies)
Discussion started by: jonesdk5
0 Replies

4. Shell Programming and Scripting

perl script - adding restart logic

Hi all I have written a perl script which looks at one file and if new entry is made to that file then it runs some scripts depending upon the entry made to file( used File::Tail module ) . This script is running as “root” in nohup mode. Script works fine but I want to add restart logic. If... (4 Replies)
Discussion started by: zedex
4 Replies
Login or Register to Ask a Question