backup selector changed
This commit is contained in:
parent
3d8327112d
commit
70b0087b89
17
restore.sh
17
restore.sh
@ -26,13 +26,15 @@ rsync_dir_list=($(rsync --password-file=rsync_pass rsync://$source | awk '{print
|
|||||||
##choose backup
|
##choose backup
|
||||||
|
|
||||||
echo "==>" ${#rsync_dir_list[@]} backups: ${rsync_dir_list[@]}
|
echo "==>" ${#rsync_dir_list[@]} backups: ${rsync_dir_list[@]}
|
||||||
read -p "Input backup number:" backupNum
|
read -p "Input backup name:" backupName
|
||||||
|
|
||||||
until [ $backupNum -le ${#rsync_dir_list[@]} ]
|
echo "Selected: " $backupName
|
||||||
do
|
|
||||||
read -p "Input backup number:" backupNum
|
#until [ $backupNum -le ${#rsync_dir_list[@]} ]
|
||||||
done
|
#do
|
||||||
let "backupNum -= 1"
|
#read -p "Input backup name:" backupName
|
||||||
|
#done
|
||||||
|
#let "backupNum -= 1"
|
||||||
|
|
||||||
|
|
||||||
##set target drive
|
##set target drive
|
||||||
@ -138,7 +140,8 @@ mount $targetDrive"2" /mnt/boot
|
|||||||
|
|
||||||
##rsync
|
##rsync
|
||||||
echo "==> Copying from NAS..."
|
echo "==> Copying from NAS..."
|
||||||
rsync --archive --password-file=rsync_pass rsync://$source${rsync_dir_list[$backupNum]}/ /mnt/
|
#rsync --archive --password-file=rsync_pass rsync://$source${rsync_dir_list[$backupNum]}/ /mnt/
|
||||||
|
rsync --archive --password-file=rsync_pass rsync://$source$backupName/ /mnt/
|
||||||
retVal=$?
|
retVal=$?
|
||||||
if [ $retVal -ne 0 ]; then
|
if [ $retVal -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user