psy0rz / zfs_autobackup

ZFS autobackup is used to periodicly backup ZFS filesystems to other locations. Easy to use and very reliable.
https://github.com/psy0rz/zfs_autobackup
GNU General Public License v3.0
583 stars 62 forks source link

zfs-autobackup not actually sending anything? #244

Closed haasn closed 7 months ago

haasn commented 7 months ago

The command seems to run successfully:

$ /opt/zfs_autobackup/bin/zfs-autobackup -v --ssh-config /var/lib/zbackup/.ssh/config --ssh-target tina --no-snapshot --destroy-missing 30d --zfs-compressed --clear-mountpoint tina zbackups
  zfs-autobackup v3.2 - (c)2022 E.H.Eefting (edwin@datux.nl)

  Selecting dataset property : autobackup:tina
  Snapshot format            : tina-%Y%m%d%H%M%S
  Timezone                   : Local
  Hold name                  : zfs_autobackup:tina

  #### Source settings
  [Source] Using custom SSH config: /var/lib/zbackup/.ssh/config
  [Source] Keep the last 10 snapshots.
  [Source] Keep every 1 day, delete after 1 week.
  [Source] Keep every 1 week, delete after 1 month.
  [Source] Keep every 1 month, delete after 1 year.

  #### Selecting
  [Source] monolith: Selected
  [Source] monolith/DOCKER: Selected
  [Source] monolith/DOCKER/0675ffa82cccb4762ff3c2aeef6447fd6b974ce8e6a6d3d25496380a4b318de5: Selected
...
  [Source] monolith/HOME: Selected
  [Source] monolith/HOME/nand: Selected
  [Source] monolith/HOME/nand/.cache: Excluded
  [Source] monolith/HOME/nand/cms: Selected
  [Source] monolith/HOME/nand/dev: Selected
  [Source] monolith/HOME/nand/downloads: Selected
  [Source] monolith/HOME/nand/games: Selected
  [Source] monolith/HOME/nand/mail: Selected
  [Source] monolith/HOME/root: Selected
  [Source] monolith/MEDIA: Selected
  [Source] monolith/MEDIA/family: Selected
  [Source] monolith/MEDIA/old: Selected
  [Source] monolith/MEDIA/scratchpad: Selected
  [Source] monolith/QEMU: Selected
  [Source] monolith/QEMU/windows11: Selected
  [Source] monolith/ROOT: Selected
  [Source] monolith/ROOT/gentoo: Selected
  [Source] monolith/ROOT/tumbleweed: Selected
  [Source] monolith/ROOT/tumbleweed/debug: Selected
  [Source] monolith/ROOT/tumbleweed/debug/src: Selected

  #### Target settings
  [Target] Using custom SSH config: /var/lib/zbackup/.ssh/config
  [Target] SSH to: tina
  [Target] Keep the last 10 snapshots.
  [Target] Keep every 1 day, delete after 1 week.
  [Target] Keep every 1 week, delete after 1 month.
  [Target] Keep every 1 month, delete after 1 year.
  [Target] Receive datasets under: zbackups

  #### Synchronising
  [Source] monolith: sending to zbackups/monolith
  [Source] monolith/DOCKER: sending to zbackups/monolith/DOCKER
  [Source] monolith/DOCKER/0675ffa82cccb4762ff3c2aeef6447fd6b974ce8e6a6d3d25496380a4b318de5: sending to zbackups/monolith/DOCKER/0675ffa82cccb4762ff3c2aeef6447fd6b974ce8e6a6d3d25496380a4b318de5
...
  [Source] monolith/HOME: sending to zbackups/monolith/HOME
  [Source] monolith/HOME/nand: sending to zbackups/monolith/HOME/nand
  [Source] monolith/HOME/nand/cms: sending to zbackups/monolith/HOME/nand/cms
  [Source] monolith/HOME/nand/dev: sending to zbackups/monolith/HOME/nand/dev
  [Source] monolith/HOME/nand/downloads: sending to zbackups/monolith/HOME/nand/downloads
  [Source] monolith/HOME/nand/games: sending to zbackups/monolith/HOME/nand/games
  [Source] monolith/HOME/nand/mail: sending to zbackups/monolith/HOME/nand/mail
  [Source] monolith/HOME/root: sending to zbackups/monolith/HOME/root
  [Source] monolith/MEDIA: sending to zbackups/monolith/MEDIA
  [Source] monolith/MEDIA/family: sending to zbackups/monolith/MEDIA/family
  [Source] monolith/MEDIA/old: sending to zbackups/monolith/MEDIA/old
  [Source] monolith/MEDIA/scratchpad: sending to zbackups/monolith/MEDIA/scratchpad
  [Source] monolith/QEMU: sending to zbackups/monolith/QEMU
  [Source] monolith/QEMU/windows11: sending to zbackups/monolith/QEMU/windows11
  [Source] monolith/ROOT: sending to zbackups/monolith/ROOT
  [Source] monolith/ROOT/gentoo: sending to zbackups/monolith/ROOT/gentoo
  [Source] monolith/ROOT/tumbleweed: sending to zbackups/monolith/ROOT/tumbleweed
  [Source] monolith/ROOT/tumbleweed/debug: sending to zbackups/monolith/ROOT/tumbleweed/debug
  [Source] monolith/ROOT/tumbleweed/debug/src: sending to zbackups/monolith/ROOT/tumbleweed/debug/src
  [Target] zbackups/monolith.syncoid/DOCKER/1db56c92ca968a9482fb1fb5fd1e5331c5af663098acb6ec69d9591a7bd48d3d: Destroy missing: has no snapshots made by us (please destroy manually).
  [Target] zbackups/monolith.syncoid/DOCKER/1ubonpwqm3uhr9kyxi7de0r2f: Destroy missing: has no snapshots made by us (please destroy manually).
  [Target] zbackups/monolith.syncoid/DOCKER/1x3ykzgbjx4u5fxtwbya0tk6v: Destroy missing: has no snapshots made by us (please destroy manually).
  [Target] zbackups/monolith.syncoid/DOCKER/b277c7a9226b026612afd02d59b1052af154e83710d4fb7aec171429cf16519c: Destroy missing: has no snapshots made by us (please destroy manually).
  [Target] zbackups/monolith.syncoid/DOCKER/d2ce99614e6fa91fbd3059733624364e9843fa8ebe527f4bf5e0e55863784c98: Destroy missing: has no snapshots made by us (please destroy manually).
  [Target] zbackups/monolith.syncoid/DOCKER/q432xftlgzpac31m6gev76mba: Destroy missing: has no snapshots made by us (please destroy manually).
  [Target] zbackups/monolith.syncoid/DOCKER/tur7vbph5yg4vy7zjtxhl3m5b: Destroy missing: has no snapshots made by us (please destroy manually).
  [Target] zbackups/monolith.syncoid/DOCKER/u4d3kbjk6xk6vfnh8569zre1z: Destroy missing: has no snapshots made by us (please destroy manually).
  [Target] zbackups/monolith.syncoid/DOCKER/v5r6k1l01ckcgmqvxdvbj62x3: Destroy missing: has no snapshots made by us (please destroy manually).
  [Target] zbackups/monolith.syncoid/HOME/nand: Destroy missing: has no snapshots made by us (please destroy manually).

  #### All operations completed successfully

Yet.. it didn't do anything. Nothing was sent. Running with --debug, I get e.g.:

  [Source] monolith/HOME: sending to zbackups/monolith/HOME
# [Target] zbackups/monolith/HOME: Determining start snapshot
# [Target] zbackups/monolith/HOME: Checking if filesystem exists
# [Target] CMD    > (ssh -F /var/lib/zbackup/.ssh/config tina 'zfs list zbackups/monolith/HOME')
# [Target] STDERR > cannot open 'zbackups/monolith/HOME': dataset does not exist
# [Source] monolith/HOME: Checking if filesystem exists: was forced to True
# [Source] monolith/HOME: Getting snapshots
# [Source] CMD    > (zfs list -d 1 -r -t snapshot -H -o name monolith/HOME)
# [Target] zbackups/monolith/HOME: Creating virtual target snapshots
# [Source] monolith/HOME: Getting zfs properties
# [Source] CMD    > (zfs get -H -o property,value -p all monolith/HOME)
  [Source] monolith/HOME/nand: sending to zbackups/monolith/HOME/nand
# [Target] zbackups/monolith/HOME/nand: Determining start snapshot
# [Target] zbackups/monolith/HOME/nand: Checking if filesystem exists
# [Target] CMD    > (ssh -F /var/lib/zbackup/.ssh/config tina 'zfs list zbackups/monolith/HOME/nand')
# [Target] STDERR > cannot open 'zbackups/monolith/HOME/nand': dataset does not exist
# [Source] monolith/HOME/nand: Checking if filesystem exists: was forced to True
# [Source] monolith/HOME/nand: Getting snapshots
# [Source] CMD    > (zfs list -d 1 -r -t snapshot -H -o name monolith/HOME/nand)
# [Target] zbackups/monolith/HOME/nand: Creating virtual target snapshots
# [Source] monolith/HOME/nand: Getting zfs properties
# [Source] CMD    > (zfs get -H -o property,value -p all monolith/HOME/nand)

Where's the actual zfs send / zfs receive call? It's as though I passed --dry-run, yet I definitely didn't.

haasn commented 7 months ago

It seems this is caused by --no-snapshot. I added that because I already had an existing auto-snapshot setup (using zfs-auto-snapshot from zfstools), and thus merely want to replicate my existing snapshots to the target pool. According to the manual, I thought this use case would work? What's going on here?

psy0rz commented 7 months ago

only snapshots that match the snapshot-format are transferred, unless you use --other-snaphots

see: https://github.com/psy0rz/zfs_autobackup/wiki/Manual#step-34-transferring-snapshots