]> arthur.barton.de Git - backup-script.git/commitdiff
Create the system directory as subvolume when using generations
authorAlexander Barton <alex@barton.de>
Wed, 29 Jul 2015 08:41:37 +0000 (10:41 +0200)
committerAlexander Barton <alex@barton.de>
Wed, 29 Jul 2015 08:41:37 +0000 (10:41 +0200)
This is required for ZFS in the future and shouldn't be a problem on btrfs.

bin/backup-script

index 8da13700f2c790a323f4e5558588da531a6ae8ce..07aee8094c02d472ec0752a34995377e31a4adbf 100755 (executable)
@@ -355,8 +355,12 @@ for f in $sys; do
 
        sys_target="$target/$fname"
        sys_root="$sys_target"
-       if [ "$DRYRUN" -eq 0 ]; then
-               mkdir -p "$sys_target" >/dev/null 2>&1
+       if [ "$DRYRUN" -eq 0 -a ! -e "$sys_target" ]; then
+               if [ $generations -gt 0 ]; then
+                       CreateSubvolume "$sys_target"
+               else
+                       mkdir -p "$sys_target"
+               fi
                if [ $? -ne 0 ]; then
                        echo "Can't create \"$sys_target\"!? \"$system\" skipped!"
                        echo; continue