4
if [ "`id -ur`" != '0' ]; then
5
echo 'Error: you must be root.'
10
rm -rf backup* restore*
12
cd ~/workspace/duplicity-0.6-series
13
echo "***** Do not disturb the control backup! "
14
PASSPHRASE=foo ./bin/duplicity --exclude="**/udev/devices/*" --name=test-backup1 /lib file:///tmp/backup1
16
echo -n "***** Now hit Ctrl-C at random intervals. Hit any key to continue... "
20
trap "pkill -INT duplicity" SIGINT
23
while [ "$RC" == "4" ]; do
24
PASSPHRASE=foo ./bin/duplicity --exclude="**/udev/devices/*" --name=test-backup2 -v5 /lib file:///tmp/backup2
27
if [ "$RC" != "4" ] && [ "$RC" != "0" ]; then
30
if [ "$REPLY" == "Y" ] || [ "$REPLY" == "y" ]; then
40
echo "Restoring backups..."
41
PASSPHRASE=foo ./bin/duplicity --name=test-backup1 file:///tmp/backup1 /tmp/restore1
42
PASSPHRASE=foo ./bin/duplicity --name=test-backup2 file:///tmp/backup2 /tmp/restore2
44
echo "Diff between /lib and /tmp/restore1"
45
diff -qr /lib /tmp/restore1 | grep -v "Only in /lib/udev/devices"
47
echo "Diff between /tmp/restore1 and /tmp/restore2"
48
diff -qr /tmp/restore1 /tmp/restore2