Using Parallel in a Maintenance Script

bobrains

Newcomer
Joined
Aug 4, 2009
Messages
1
Reaction score
0
Points
0
During the processing of my daily maintenance I am issuing the following commands:

parallel
backup stg diskpool1 copypool1 process=4 wait=yes
backup stg diskpool2 copypool2 process=4 wait=yes

/* this is copying data from my primary disk pools to my copy pools

serial
parallel
backup stg tapepool1 copypool1 process=2 wait=yes
backup stg tapepool2 copypool2 process=2 wait=yes

/* this is catching anything that happened to overflow due to a triggered migration

serial

/* remaining maintenance commands are here


My question is regarding the "serial" stuck in the middle. I need the disk to tape copies to complete before the tape to tape copies begin. My assumption is that the serial command is needed to delimit the first two backup commands from the next two. Am I correct in this thinking?

Thanks much,
Bob
 
You will need the first serial you have specified if you want to track the return code from the first 2 backup stg commands run in parallel. I believe Toxy13 is saying if you don't care about the return code from the first 2 parallel commands, you can just issue another parallel and the 2nd set of backup stg commands. Personally, I always put the serial in just to better indicate to others that the prior set is supposed to complete successfully before next set of parallel commands.
 
Serial causes it to wait for all the parallels you started just beforehand.

I wasn't aware that a parallel would also cause it to wait for the processes before to finish - I am not sure if that is true or not to be honest, maybe toxy misunderstood. But I haven't tested it so I guess its possible.

As Eldoraan said, better to leave it in as its more "self documenting" and makes it easier for people to understand.
 
Back
Top