Listing 4: incrbak.sh
#
# incrbak.sh:
# Make incremental backup of a filesystem.
# Place in currently selected dataset.
#
# usage: incrbak.sh <filesystem>
# examples:
# incrbak.sh u1
# incrbak.sh u3
#
ROOT=/
CTARDIR=/u3/Backup/Logs; export CTARDIR
OPTIONS=c8VIP
TMPDIR=/u5/dumpdir;export TMPDIR
ADMIN=admin # user/alias to send mail to in case of error
[ $# -ne 1 ] && echo "usage: $0 <filesystem>" && exit 1
cd $ROOT
if [ $1 != root ]; then
cd $1
ctar $OPTIONS .
else
ctar ${OPTIONS}EEEEEEE ./u ./u1 ./u2 ./u3 ./u4 ./u5 ./mnt .
fi
if [ $? -ne 0 ]; then
/usr/bin/mail -s "ctar error" $ADMIN <<END
There was an error in incremental backups. Please check the log file
(it is /u3/Backup/Logs/Last_Incr).
END
fi
|