diff --git a/backup.fish b/backup.fish index 1c16503..81b63f0 100755 --- a/backup.fish +++ b/backup.fish @@ -26,6 +26,7 @@ end mkdir $LUKS_MOUNT sudo cryptsetup open --type luks $LUKS_DEVICE $LUKS_NAME sudo mount /dev/mapper/$LUKS_NAME $LUKS_MOUNT +echo "$LUKS_NAME" > .luks-device " if test "$argv" = '--browse' @@ -40,7 +41,7 @@ else echo "Syncing filesystem..." set_color normal - rsync --exclude-from=$RSYNC_IGNORE_FILE -rlptgozE ~ $USER@$REMOTE:$REMOTE_PATH #TODO find more applicable options + rsync --exclude-from=$RSYNC_IGNORE_FILE -rlptgozEv --delete ~ $USER@$REMOTE:$REMOTE_PATH #TODO find more applicable options end @@ -48,8 +49,10 @@ end set_color -o green echo "Syncing complete - unmounting luks container..." set_color normal +read -P "Continue? Just press enter to start unmounting! " ssh -t -i $KEY $USER@$REMOTE " sudo umount $LUKS_MOUNT -sudo cryptsetup close --type luks $LUKS_NAME +sudo cryptsetup close --type luks (cat .luks-device) rmdir $LUKS_MOUNT -" \ No newline at end of file +rm .luks-device +"