oetiker / znapzend

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

Wrong runonce arg processing. #573

Closed syswipe closed 2 years ago

syswipe commented 2 years ago

Hi! I tried to check my backup plan using:

/opt/znapzend-0.21.0/bin/znapzend --debug --runonce data/nfs --noaction

but I've got a very strange error:

[Sun Mar 13 09:54:16 2022] [info] znapzend (PID=13986) starting up ...
[Sun Mar 13 09:54:16 2022] [info] refreshing backup plans...
cannot open '1': filesystem does not exist
ERROR: no backup set defined or enabled, yet. run 'znapzendzetup' to setup znapzend

the backup plan is:

*** backup plan: data/nfs ***
           dst_0 = backup-main.int.local.net:data/nfs
      dst_0_plan = 1month=>8hours,3months=>1day,6months=>1week,1year=>1month
         enabled = on
         mbuffer = /usr/local/bin/mbuffer:9000
    mbuffer_size = 1G
   post_znap_cmd = off
    pre_znap_cmd = off
       recursive = on
             src = data/nfs
        src_plan = 4weeks=>8hours
        tsformat = %Y-%m-%d-%H%M%S
      zend_delay = 22

I ran znapzend in debug mode, and I've found that it takes runonce value (which equals 1 ) instead of dataset name and passes one to the getBackupSetEnabled function...

ZnapZend::CODE(0x8d14a10)(/opt/znapzend/lib/ZnapZend.pm:124):
124:        my $dataSet = shift;
  DB<8> x $self
0  ZnapZend=HASH(0x8d87d98)
   'daemonize' => 0
   'dataset' => 'data/nfs'
   'debug' => 1
   'forbidDestRollback' => 0
   'loglevel' => 'debug'
   'logto' => ''
   'lowmemRecurse' => 0
   'noaction' => 1
   'recursive' => 0
   'runonce' => 1
   'zLog' => Mojo::Log=HASH(0x8d6d104)
      'events' => HASH(0x8d6d140)
         'message' => ARRAY(0x8d87e74)
            0  CODE(0x8782134)
               -> &Mojo::Log::_message in /opt/znapzend/lib/Mojo/Log.pm:59-70
      'format' => CODE(0x8781e00)
         -> &Mojo::Log::_format in /opt/znapzend/lib/Mojo/Log.pm:53-55
      'handle' => GLOB(0x8074eb4)
         -> *main::STDERR
               FileHandle({*main::STDERR}) => fileno(2)
      'history' => ARRAY(0x8d6d26c)
         0  ARRAY(0x8dacac8)
            0  1647179224
            1  'info'
            2  'znapzend (PID=17716) starting up ...'
      'level' => 'debug'
      'max_history_size' => 10
      'path' => undef
   'zfsGetType' => 0
  DB<9> x $dataSet
0  undef
  DB<10> n
ZnapZend::CODE(0x8d14a10)(/opt/znapzend/lib/ZnapZend.pm:126):
126:        $self->zLog->info('refreshing backup plans...');
  DB<10> x $dataSet
0  1
  DB<11> p $dataSet
1
  DB<12> n
[Sun Mar 13 09:48:23 2022] [info] refreshing backup plans...
ZnapZend::CODE(0x8d14a10)(/opt/znapzend/lib/ZnapZend.pm:127):
127:        $self->backupSets($self->zConfig->getBackupSetEnabled($dataSet));
  DB<12> n
cannot open '1': filesystem does not exist
stale[bot] commented 2 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.