Compare commits
No commits in common. "70b0087b895a2d14afcc7e3e8fdb241d7c84354b" and "fb856ac8d562bbd33561fc67dc5526e90263d548" have entirely different histories.
70b0087b89
...
fb856ac8d5
21
restore.sh
21
restore.sh
@ -26,15 +26,13 @@ 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 name:" backupName
|
read -p "Input backup number:" backupNum
|
||||||
|
|
||||||
echo "Selected: " $backupName
|
until [ $backupNum -le ${#rsync_dir_list[@]} ]
|
||||||
|
do
|
||||||
#until [ $backupNum -le ${#rsync_dir_list[@]} ]
|
read -p "Input backup number:" backupNum
|
||||||
#do
|
done
|
||||||
#read -p "Input backup name:" backupName
|
let "backupNum -= 1"
|
||||||
#done
|
|
||||||
#let "backupNum -= 1"
|
|
||||||
|
|
||||||
|
|
||||||
##set target drive
|
##set target drive
|
||||||
@ -44,8 +42,8 @@ do
|
|||||||
read -p "Target drive is " targetDrive
|
read -p "Target drive is " targetDrive
|
||||||
targetDrive=/dev/$targetDrive
|
targetDrive=/dev/$targetDrive
|
||||||
done
|
done
|
||||||
echo "Encrypted? (Y/n) "
|
echo "Encrypted?"
|
||||||
while read -r -n 1 answer ; do
|
while read -r -n 1 -s answer ; do
|
||||||
if [[ $answer = [YyNn] ]]; then
|
if [[ $answer = [YyNn] ]]; then
|
||||||
[[ $answer = [Yy] ]] && encryptedDevice=true && echo "WARNING You will be asked for password later" #read -p "Password: " encryptedPassword
|
[[ $answer = [Yy] ]] && encryptedDevice=true && echo "WARNING You will be asked for password later" #read -p "Password: " encryptedPassword
|
||||||
[[ $answer = [Nn] ]] && encryptedDevice=false
|
[[ $answer = [Nn] ]] && encryptedDevice=false
|
||||||
@ -140,8 +138,7 @@ 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