Re: How do you store info for DR?
1997-12-03 20:54:00
>Actually, I'm not very good with korn shell. This script was written
by
>an IBM contractor who was helping us set up our system. Maybe I
>misunderstood you, but I did try the statement you listed and it just
>puts a '/' instead of the file system mount points in the exclude
file.
Yes, but the mount points are not necessary. savevg compares each
file in the filesystem(s) to the lines in the exclude file using grep.
Since you want to exclude everything, the simplest thing is to use a
single pattern that will match whatever find puts out. For example,
the first 10 lines from a find in my usr fs are:
./usr
./usr/lost+found
./usr/lpp
./usr/lpp/bos
./usr/lpp/bos/liblpp.a
./usr/lpp/bos/inst_root
./usr/lpp/bos/aix_release.level
./usr/lpp/bos/README
./usr/lpp/bos/README.SPEC1170
./usr/lpp/bos/migrate
I used "/" as my pattern because every file has a slash. It just
makes for a simpler exclude file. As a test I tried "." which is the
wildcard for any character, but the grep takes longer.
Here is how I've modified the script you sent over (Note I changed the
options for savevg from -emf to -eif because map files aren't as
important for me.)
--- CUT ---
#!/bin/ksh
#!/bin/ksh
base=`basename $0`
errors=0
lsvg -o | grep -v "^rootvg$" |
while read VGNAME
do
echo / > /etc/exclude.$VGNAME
echo "${base}: Running \"savevg -eif /savevg.$VGNAME $VGNAME\""
savevg -eif /savevg.$VGNAME $VGNAME
rc=$?
if [ "$rc" -ne 0 ]
then
echo "${base}: savevg returned code $rc on $VGNAME."
let "errors = errors + 1"
fi
done
if [ "$errors" -gt 0 ]
then
echo "${base}: $errors savevgs failed."
exit 1
else
echo "${base}: All savevgs completed successfully."
exit 0
fi
--- CUT ---
Thanks,
Thanks,
Owen
|
|
|