[Previous] [Contents] [Index] [Next]

Backup.s

This is a sample shell script for using SecondCopy.

#!/bin/sh
# backup.s, 27 May 1997

# uncomment the next line to display the command lines during execution
#set -v

# set the variable DEVICE to the device name of the Tandberg tape drive
DEVICE=/dev/st0

# clean up any old status files
rm /tmp/slog /tmp/vlog

echo "STEP 1, make a report of the directories"

find / \( -type d  ! -pname '/proc*' \) \
	| scdir report >/tmp/dir.report

echo "STEP 2, initialize the tape and save the directory report"

# if your tape drive does not support compression, change "compress yes" to
# "compress no"
echo /tmp/dir.report | secondcopy $DEVICE verbose links \
	"compress yes" "init YOUR_NAME_HERE" save

echo "STEP 3, save files excluding the /tmp directory, and those "
echo "files which cannot be restored"

find / \( ! -type d ! -pname '/proc*' ! -pname '/tmp*' \) | secondcopy \
	$DEVICE verbose "e /tmp/slog" links compress save 

echo "STEP 4, verify all the files on the tape"

echo \* | secondcopy $DEVICE verbose "e /tmp/vlog" continue verify

echo "STEP 5, inspect the error files"

if test -s /tmp/slog
then
	more /tmp/slog
else
	echo "All the files selected by your find command were saved."
fi

if test -s /tmp/vlog
then
	more /tmp/vlog
else
	echo "All files on the tape matched the copies on the disk."
fi

[Previous] [Contents] [Index] [Next]