3 if [ -z "$mountdir" ]; then
4 echo >&2 '$mountdir must be set'
8 if [ -z "$rundir" ]; then
9 echo >&2 '$rundir must be set'
13 export PATH=${rundir%%/}:/bin:/usr/bin:/sbin:/usr/sbin:/sw/bin
15 if [ $# != 2 -o ! -d "$1" -o ! -d "$2" ]; then
16 echo >&2 "Usage: $0 <source-directory> <target-directory>"
17 echo >&2 "Example: $0 / /"
21 device=$(mount | grep "on ${mountdir%%/} " | awk '{print$1}')
23 if [ -z "$device" ]; then
24 echo >&2 "Cannot determine cdrom device"
28 cp ${mountdir%%/}/backups.db ${mountdir%%/}/backup-status.txt $rundir
29 dbfile=${rundir%%/}/backups.db
31 dates=$(cat $dbfile | list-dates.sh)
33 for date in $dates; do
37 echo >&2 "Please insert backup disk: $date"
42 mount -t ext2 $device ${mountdir%%/}
44 if grep -q $date ${mountdir%%/}/backup-status.txt; then
47 echo >&2 "This doesn't seem to be the right disk."
51 rsyncopts="-W -H -S -l -p -t -g -o -0 --files-from=- --stats --progress"
52 cat $dbfile | files-from-date.sh $date | rsync $rsyncopts ${mountdir%%/}/ ${2%%/}/