#web_snapshot_restore #!/bin/bash # This script restores a snapshot to a client machine. # Version 0.1, Darrel O'Pry, April 23, 2003 # Thing.net Communications, LLC # usage: web_snapshot_restore client file # use trailing slash for directories, just the filename for files # get command line args client=$1 file=$2 # Configuration backupRoot=/backup/web/$client #List snapshots available for restore snapShots=`ls -aldt $backupRoot/*.* | awk '{print $6"_"$7"_"$8"_"$9}'` item=0 echo Select to the backup you wish to restore to $client:$file for choice in ${choices[@]}; do echo $((item++)). $choice done echo -n Select number of snapshot to restore[e.g. 1 2 3]: read selected choice=${choices[$selected]} restore=`echo $choice | awk -F _ '{print $4}'` rsync -e ssh -a $restore$file $client:$file #end script