Umbrella Scripting(very Urgent)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Umbrella Scripting(very Urgent)
# 1  
Old 04-02-2008
Umbrella Scripting(very Urgent)

Hi All,

Can anybody help me to write the umbrella script for the following?

I have three steps to do.

STEP 1: CONVERT XML files to PS files

STEP 2: CONVERT ALL PS FILES TO PDF FILES

STEP 3: FTPING ALL PDF FILES TO THE SERVER.

I have the codes for the above three steps.

Now I want to write such an Umbrella script to integrating the above 3 steps. So that it will execute after STEP 1, STEP 2 and after STEP 2, STEP3.
And if connection will be broken in STEP 2 then it won't go to next STEP 3.
When next time I will start running the script then it should start the doing the jobs from where it is broken??? For example if it is broken in STEP 3 then it will start doing the job from STEP 3.


CAN ANYBODY HELP ME TO WRITE THE UMBRELLA SCRIPT LIKE THE ABOVE REQUIRED SPECIFICATION??????????

IT IS VERY URGENT. If anybody helps me then really I am grateful to that guy.
# 2  
Old 04-03-2008
Can anybody atleast reply to this Problem, plzzzzzzzzzzzzz
# 3  
Old 04-03-2008
see if this logic helps

Code:
#!/bin/ksh
check for control file. if empty then proceed from STEP 1;
if it exists check the last entry & continue ur processing from the next step

status=0
##first set of actions##
if success --> then write a number/status to control file and proceed.
status=1


if [[ status == 1 ]]
then
##execute the second set of actions
if success --> then write a number/status to control file and proceed.
status=2
fi

if [[ status == 2 ]]
then
##execute the third set of actions
#check for failures and process appropriately.
#if success, remove the control file and exit successfully
fi

# 4  
Old 04-04-2008
I tried but it is not working

Hi ranj@chn,

How to check check for control file. if empty then proceed from STEP 1;

I need it very urgently. because Monday is my deadline for doing this Umbrella script.
# 5  
Old 04-04-2008
empty file

Code:
if [[ ! -s $filename ]]
then
 echo "file is empty"
 exit -1
fi

# 6  
Old 04-04-2008
okay, for you to know whether the command was successful or not, each of the three scripts have to return come sort of code, like 0 for success and nonzero for failure.

then, you write a wrapper like this

#!/bin/sh

#Try doing "step 1" five times
step1timedout=1
for k in 1 2 3 4 5
do

#STEP 1: CONVERT XML files to PS files
convert_xml_files_to_ps.sh #replace this with your command

#get the return code
retcode=$?

#if success, break from loop
if [ $retcode -eq 0]
then
step1timedout=0
break
fi
done

#Check if step 1 timed out
if [ $step1timedout -eq 1]
then
echo "Step 1 failed to execute after 5 tries, aborting execution..."
exit 255
fi

#STEP 2: CONVERT ALL PS FILES TO PDF FILES
#repeat the code for step 1

#STEP 3: FTPING ALL PDF FILES TO THE SERVER.
#repeat the code for step 1

#end of script
exit 0

Note that this is what the script will do:
1. will try executing step 1. if it is successful, it will proceed for step 2. If step 1 fails after 5 tries, the whole script will exit.
2. Step 2 will execute with the same logic
3. Step 3 will execute with the same logic

Now if you want to repeat the whoel process in a loop, you can put the whole thing in a for loop and so it as many times as you like.
# 7  
Old 04-04-2008
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies

2. Shell Programming and Scripting

Need urgent help with PERL scripting

From the attached file I to need pick all rows that have AVG2 column value larger than 0.050, and write those values in to a separate file. Help me on how I pick the approp value & output them onto a file. Very Thanks in advance. :b: (5 Replies)
Discussion started by: tonystark
5 Replies

3. Shell Programming and Scripting

it's urgent ! round number in perl scripting

my $number = 12.345673412 I need 3 digits after decimal or after dot(.) i mean , i need only 12.345 I used int(), ceil(), floor() but it gives me only 12 I need it. (10 Replies)
Discussion started by: pritish.sas
10 Replies

4. Shell Programming and Scripting

Urgent Korn Shell scripting Help Pleaaaase...

Hello All, Can someone help me to set a user's password from the script using korn shell. The password change is a one time password after user account creation. I tried providing the input file as the value for password field but password change requires tty so my password from an input file... (3 Replies)
Discussion started by: solaix14
3 Replies

5. UNIX for Advanced & Expert Users

Umbrella script

Hi All, Can anybody help me to write the umbrella script for the following? I have three steps to do. STEP 1: CONVERT XML files to PS files STEP 2: CONVERT ALL PS FILES TO PDF FILES STEP 3: FTPING ALL PDF FILES TO THE SERVER. I have the codes for the above three steps. Now I... (3 Replies)
Discussion started by: sunitachoudhury
3 Replies

6. Shell Programming and Scripting

Please help me out:-Its Urgent-C Shell Scripting

Hi Friends, I am new to this forum as well as new to shell scripting. I have a problem here and i need someone to solve this. Let us consider there are two processes(abc & def).There is a script which kills these two processes(i.e killtheprocess abc). Here abc is the argument . There... (0 Replies)
Discussion started by: Prince89
0 Replies

7. UNIX for Advanced & Expert Users

URGENT,URGENT- Need help tape drive installation

Hi, I am trying to attach tape drive to sun V890 running Solaris 9 on it. I have installed HBA(qlogic) in slot 1 of 0-8 slots and booted the system. I do not see HBAin prtdiag output. The tape drive is not attached to HBA. The tape drive I am going to attach is Sony AIT3. 1.How can I make... (3 Replies)
Discussion started by: sriny
3 Replies

8. Shell Programming and Scripting

help needed in shell scripting......urgent

Dear friends, please help me to solve following problem. I'm running a frontend application from which i'll be invoking the shell script with arguments as given below -driver -w -p "ABC XYZ" -S -ds con -dn "abc xyz" i am getting $1=-driver $2=-w $3=-p $4="ABC $5=XYZ" $6=-S $7=-ds... (3 Replies)
Discussion started by: swamymns
3 Replies
Login or Register to Ask a Question