oetiker / znapzend

zfs backup with remote capabilities and mbuffer integration.
www.znapzend.org
GNU General Public License v3.0
607 stars 137 forks source link

uninitialized value if destination does not exist in znapzendztatz #485

Closed moetiker closed 3 years ago

moetiker commented 4 years ago

Hi

if a destination does not exist znapzendztatz -r has a perl error in the output

cannot open 'tank01/backup/badile/share/vlsi': dataset does not exist
Use of uninitialized value $usedBySnap in scalar chomp at /opt/ooce/znapzend/lib/ZnapZend/ZFS.pm line 961.
Use of uninitialized value in subtraction (-) at /opt/ooce/bin/znapzendztatz line 23.
Use of uninitialized value in print at /opt/ooce/bin/znapzendztatz line 25.
        No Snapshots Yet     root@server:tank01/backup/badile/share/vlsi
jimklimov commented 3 years ago

@moetiker : can you please check if this is still an issue with master branch code? I can't reproduce it...

Neither for child datasets recently created under a "root" of some backup schedule:

jim@jimoi:~/shared/znapzend$ sudo zfs create nvpool/SHARED/zztest
jim@jimoi:~/shared/znapzend$ ./bin/znapzendztatz -r nvpool/SHARED/zztest
ERROR: cannot list backup config

jim@jimoi:~/shared/znapzend$ ./bin/znapzendztatz -r --inherited nvpool/SHARED/zztest
cannot open 'backup-adata/snapshots/nvpool/SHARED/zztest': dataset does not exist
USED    LAST SNAPSHOT                        DATASET
    0   No Snapshots Yet     nvpool/SHARED/zztest
*** WARNING: destination 'backup-adata/snapshots/nvpool/SHARED/zztest' does not exist! ***

For "roots" of backup schedules too:

jim@jimoi:~/shared/znapzend$ zfs get all nvpool/test/src | grep org.znapzend:
nvpool/test/src  org.znapzend:pre_znap_cmd   off                         local
nvpool/test/src  org.znapzend:tsformat       %Y-%m-%d-%H%M%S             local
nvpool/test/src  org.znapzend:dst_d_enabled                              local
nvpool/test/src  org.znapzend:mbuffer        off                         local
nvpool/test/src  org.znapzend:zend_delay     0                           local
nvpool/test/src  org.znapzend:enabled        on                          local
nvpool/test/src  org.znapzend:recursive      off                         local
nvpool/test/src  org.znapzend:dst_d          nvpool/test/dst             local
nvpool/test/src  org.znapzend:mbuffer_size   1G                          local
nvpool/test/src  org.znapzend:dst_d_plan     3hours=>1hours              local
nvpool/test/src  org.znapzend:src_plan       3hours=>1hours              local
nvpool/test/src  org.znapzend:post_znap_cmd  off                         local
nvpool/test/src  com.sun:auto-snapshot       false                       inherited from nvpool

jim@jimoi:~/shared/znapzend$ sudo zfs rename nvpool/test/dst nvpool/test/dst.x

jim@jimoi:~/shared/znapzend$ ./bin/znapzendztatz -r nvpool/test/src
cannot open 'nvpool/test/dst': dataset does not exist
USED    LAST SNAPSHOT       DATASET
    0   2020-08-08-023854   nvpool/test/src
*** WARNING: destination 'nvpool/test/dst' does not exist! ***
jimklimov commented 3 years ago

So it may have been fixed while addressing other issues this year :)

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.