SummaryRe: Backup script

From: RaghuNathL <raghunathl_at_lucent.com>
Date: Wed Sep 05 2001 - 03:08:04 EDT
Hello managers,
Iam putting all replies in this mail
Hi,

I beleive I understood the mail. Here is what i think.

Since you are executing the tar from the script itself, it is executed in a
subshell. thus the execution of next statement
continues. You can create a function and move the tar statement into it.
This will hold the execution of Unlock till the
function finishes. This could work out. Refer to sh(1) for details on this.

Srinivas
m:
           Doug Otto <doug.otto@npawest.com>

Tue 01:02
 Subject:
           Re: Backup script
       To:
           RaghuNathL <raghunathl@lucent.com>

Modify your script to capture the PID of tar.  Once you have it you can use

pwait (PID) to watch it.

I'm an old csh hack so your syntax may vary....


set PID=`ps -ef | grep tar | grep -v grep | awk '{print $2}'`
pwait $PID
...rest of script

problem was solved after i put "{" after #1/bin/sh and closed it after done
"; }" in the back up script i used also i introduced `date '+%M%H%' to
confirm time in the script.



RaghuNathL wrote:

> Hello Managers,
> i use the follwing script to backup clearcase, prblem is tar gives the
> control to script at same moment and vob gets unlocked before it's
> compltely backedup.
> how to make the script to wait until tar is completed?
> Any help will be appriciated.
> here is the file tags+storage.
> /software/nms/net-sim:/net/gangotri/iidcvobs/vobstore/net-sim.vbs
> /software/nms/obj:/net/gangotri/iidcvobs/vobstore/obj.vbs
> #!/bin/sh
> #This script is used for backup od clearcase repository on VOB Server at
>
> # our facility you need two things here one is a flat file which has
> list of all#vobtags and second field as storage path which should be
> reachable from backup #host (delimliter is colon).
>
> # export the SHELL that we are going to use
> SHELL=/bin/sh
> export SHELL
>
> # export the correct PATH so that all the required binaries can be found
>
> PATH=$PATH:/usr/local/bin
> export PATH
>
> # These are the valid statuses which save reports on completion of the
> backup
> statuses=" failed.  abandoned.  succeeded.  completed savetime= "
>
> # Perform the PRECMD (Lock VOB)
> for _Vobtags in `cat /var/tags+storage`
> do
> echo "$_Vobtags"
> tag=`echo $_Vobtags|cut -f1 -d :`
> storage=`echo $_Vobtags|cut -f2 -d :`
> sleep 2
> echo "$tag  locked"
> echo "$storage  storage is now getting backedup"
> /usr/atria/bin/cleartool setview -exec "/usr/atria/bin/cleartool lock
> $tag" backup_view >> /tmp/voblock.log 2>&1
> sleep 2
> /usr/local/bin/tar czvf - $storage |rsh iidcs234 dd of=/dev/rmt/3
> obs=512
> echo "$tag is just now backed up" >> /tmp/backedup
> sleep 2
> /usr/atria/bin/cleartool setview -exec "/usr/atria/bin/cleartool unlock
> $tag" backup_view >> /tmp/vobunlock.log 2>&1
> sleep 2
> done
>
> --
> Thanx&Regards
> RaghuNathL
> Ux-Administrator
> CIO-GIO Helpdesk
> Lucent-Ins
> Ph:5500061 Ex:2048
> "Change in themselves cause changes"

--
Thanx&Regards
RaghuNathL
Ux-Administrator
CIO-GIO Helpdesk
Lucent-Ins
Ph:5500061 Ex:2048
"Change in themselves cause changes"



_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Sun Sep 9 01:56:22 2001

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:25 EST