If backupdir key is missing, use root dir to mounted disk
The user can hit enter when creating a new directory (no directory is created). In doing so "backupdir" is set to nothing. Snapper does not keep that key. Upon a search of the latest incremental backup we didn't check for backupdir, we just had taken the first key (which ended up being the UUID ). We now check for the backupdir key, and if it is missing that means use the root directory on the mounted disk. Fixes #13.
This commit is contained in:
@@ -146,7 +146,7 @@ for x in $selected_configs; do
|
|||||||
BACKUPDIR="$selected_mnt/$mybackupdir"
|
BACKUPDIR="$selected_mnt/$mybackupdir"
|
||||||
mkdir -p "$BACKUPDIR"
|
mkdir -p "$BACKUPDIR"
|
||||||
else
|
else
|
||||||
mybackupdir=$(snapper -c root list -t single | awk -F"|" '/'"$selected_uuid"'/ {print $5}' | awk -F "," '{print $1}' | awk -F"=" '{print $2}')
|
mybackupdir=$(snapper -c root list -t single | awk -F"|" '/'"$selected_uuid"'/ {print $5}' | awk -F "," '/backupdir/ {print $1}' | awk -F"=" '{print $2}')
|
||||||
BACKUPDIR="$selected_mnt/$mybackupdir"
|
BACKUPDIR="$selected_mnt/$mybackupdir"
|
||||||
if [[ ! -d $BACKUPDIR ]]; then
|
if [[ ! -d $BACKUPDIR ]]; then
|
||||||
printf "ERROR: %s is not a directory on %s.\n" "$BACKUPDIR" "$selected_uuid"
|
printf "ERROR: %s is not a directory on %s.\n" "$BACKUPDIR" "$selected_uuid"
|
||||||
|
|||||||
Reference in New Issue
Block a user