Create the self-extracting archive restore.sh
[backups/.git] / scripts / restore-script.sh
1 #!/bin/sh
2
3 echo "Ran restore script with $@"
4
5 exit 0
6
7 export PATH=$rundir:/bin:/usr/bin
8
9 if [ $# != 1 ]; then
10   echo >&2 "Usage: $0 <source-directory> <target-directory>"
11   echo >&2 "Example: $0 / /"
12   exit 1
13 fi
14
15 # Get the device with the CD in it here
16 device=$(mount | grep "on $mountdir " | awk '{print$1}')
17
18 cp $mountdir/backups.db $mountdir
19
20 for date in $(cat $dbfile | list-dates.sh); do
21   eject $device
22   echo >&2 "Please insert backup disk:  $date"
23   echo >&2 "Then press any key"
24   read bogus
25   # Mount the media
26   # rsync-cmd.sh won't work here in its current encarnation
27   cat $dbfile | files-from-date.sh | rsync-cmd.sh $1
28 done