Added restore script
authorCarl Baldwin <cnb@ball.(none)>
Mon, 24 Oct 2005 19:30:21 +0000 (13:30 -0600)
committerCarl Baldwin <cnb@ball.(none)>
Mon, 24 Oct 2005 19:30:21 +0000 (13:30 -0600)
scripts/restore-script.sh [new file with mode: 0644]

diff --git a/scripts/restore-script.sh b/scripts/restore-script.sh
new file mode 100644 (file)
index 0000000..402bb84
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+if [ $# != 1 ]; then
+  echo >&2 "Usage: $0 <target-directory>"
+  echo >&2 "Example: $0 /"
+  exit 1
+fi
+
+tmpdir=/tmp/restore-$(date +%Y%m%d%H%M%S)
+
+export PATH=$tmpdir:/bin:/usr/bin
+
+# Get the device with the CD in it here
+device=/dev/hdc
+
+for date in $(cat $dbfile | list-dates.sh); do
+  eject $device
+  echo >&2 "Please insert backup disk:  $date"
+  echo >&2 "Then press any key"
+  read bogus
+  # Mount the media
+  # rsync-cmd.sh won't work here in its current encarnation
+  cat $dbfile | files-from-date.sh | rsync-cmd.sh $1
+done