dsnap-sync: cleanup verify_snapper_structure()

* only create target path, if base_path isn't empty

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2018-09-21 13:48:22 +02:00
parent 82b698750e
commit 3469000512

View File

@@ -324,7 +324,7 @@ get_media_infos () {
if [ $? -eq 0 ]; then
target_cmdline=$ltfs_mountpoint
if [ ${#volume_name} -eq 0 ]; then
#tape-admin --verbose=$verbose --ltfs-getattribute
# parse out volume-name (fuse - extended attribute)
volume_name=$($ssh attr -g ltfs.volumeName $ltfs_mountpoint)
volume_name=$(echo ${volume_name##*:} | sed -e 's/\r\n//g')
fi
@@ -2628,7 +2628,8 @@ verify_snapper_structure () {
fi
fi
# strip last dir from backup_root
base_path=${backup_root%/*}; echo $base_path
base_path=${backup_root%/*}
if [ ${#base_path} -ge 1 }; then
if [ $dryrun -eq 0 ]; then
$($ssh mkdir --mode=0700 --parents $base_path)
if [ $verbose -ge 3 ]; then
@@ -2651,6 +2652,7 @@ verify_snapper_structure () {
fi
fi
fi
fi
# verify that we have a snapper compatible structure for target config (a btrfs subvolume)
cmd="$ssh stat --format %i $backup_root 2>/dev/null"