SNBK(8)

πŸ“¦
version 0.13.0 Β· 4 versions
, in epel 10, fedora 44

✨ SNBK(8) β€” Filesystem Snapshot Management ✨

okay bestie, welcome to snbk, the snbk(8) manual page πŸ’– this is the whole thing, top to bottom, no skips, no cap.


🌸 NAME 🌸

snbk β€” a command-line program to backup snapshots of snapper. that's it, that's the vibe.


πŸŽ€ SYNOPSIS πŸŽ€

snbk [--global-opts] command [command-arguments]

snbk {--help}

πŸ’… DESCRIPTION πŸ’…

So snbk is a command-line program to backup snapshot of snapper, fr fr. It can transfer and delete backup snapshots on local and remote btrfs filesystems. that's the whole job. she's booked, she's busy, she's transferring your snapshots. πŸ‘‘


πŸ¦‹ CONCEPTS πŸ¦‹

πŸ’œ Backup Configurations πŸ’œ

For each snapper config there can be several backup configs. Each backup config defines backups of the snapper snapshots at one location, either local or remote β€” go peek at snapper-backup-configs(5) for possible settings. one config per location, that's the rule 🫢

🌈 Snapshot Statuses 🌈

Every snapshot has a status on the source and on the target. main character behavior honestly.

Possible values for the source are:

  • (empty) β€” The snapshot is missing and thus considered obsolete on the target. It will be deleted on the target by the next delete command. bye bestie πŸ’€
  • read-only β€” The snapshot is read-only. the good one, the well-behaved one ✨
  • read-write β€” The snapshot is read-write and thus cannot be backed-up. she's feral, she's not allowed on the trip πŸ™ˆ

Possible values for the target are:

  • (empty) β€” The snapshot is missing. If the source snapshot is read-only it will be transferred to the target by the next transfer command. she's just not there yet, it's fine πŸ’–
  • valid β€” The snapshot is valid. That implies it is read-only. iconic, flawless, ate πŸŽ€
  • invalid β€” The snapshot is invalid. Either the received UUID is wrong or it is read-write. That can happen if the transfer was interrupted. The next transfer command will try to transfer the snapshot again. not me getting interrupted mid-transfer 😭 she'll try again tho.

πŸ‘‘ GLOBAL OPTIONS πŸ‘‘

  • -q, --quiet β€” Suppress normal output. Error messages will still be printed, though. she's quiet, not silent 🫢
  • -v, --verbose β€” Increase verbosity. more words, more lore.
  • --debug β€” Turn on debugging. detective mode πŸ”
  • --utc β€” Display dates and times in UTC. By default, local time is used.
  • --iso β€” Display dates and times in ISO format. ISO format is always used for machine-readable outputs.
  • -t, --table-style style β€” Specifies table style. Table style is identified by an integer number.
  • --machine-readable format β€” Specifies a machine-readable output format. Possible options are csv and json. robots only, no vibes πŸ’€
  • --csvout β€” Sets CSV output format. For some commands the CSV output contains more information than the default table output. See RFC 4180[1] for the details, except lines end with a LF, not CR+LF. LF not CR+LF, write that down πŸ“
  • --jsonout β€” Sets JSON output format. For some commands the JSON output contains more information than the default table output.
  • --separator character β€” Specifies the character separator for CSV output format.
  • --no-headers β€” Suppress headers for CSV output format.
  • -b, --backup-config name β€” Use specified configuration instead of all configurations.
  • --no-dbus β€” Operate without a DBus connection.
Use with caution. ⚠️ bestie I am BEGGING you, read that twice.
  • --target-mode name β€” Only operate on backup configs with the specified target mode.
  • --automatic β€” Only operate on backup configs which have the automatic flag set.
  • --version β€” Print version and exit. short and sweet, she leaves immediately ✨

🌸 COMMANDS 🌸

snbk provides a number of commands. Each command accepts the options listed in the GLOBAL OPTIONS section. These options must be specified before the command name. In addition, many commands have specific arguments, which are listed in this section. These command-specific arguments must be specified after the name of the command. order matters bestie, don't test her πŸ’…

  • help β€” Show short help text.
  • list-configs β€” List available configurations.
  • list (ls) β€” List snapshots.
  • transfer [number] β€” Transfer all missing snapshots or the specified snapshot to the target.
  • delete (remove|rm) [number] β€” Delete all obsolete snapshots or the specified snapshot from the target.
  • transfer-and-delete β€” Combines transfer and delete. two birds, one command πŸ¦‹

🧚 RESTORE 🧚

So far a restore has to be done manually. There are several methods to do a restore, e.g. the backup can be mounted and then copied or rsync can be used. Here we provide an example on how to use btrfs send and btrfs receive to restore a snapshot on the source system. In general using btrfs send and btrfs receive is a bit tricky. ngl, it's giving boss level 🫠

When using target-mode local:

# mkdir /.snapshots/42
# cp /backups/root/42/info.xml /.snapshots/42/
# btrfs send /backups/root/42/snapshot | btrfs receive /.snapshots/42

When using target-mode ssh-push:

# mkdir /.snapshots/42
# scp backups.example.com:/backups/eberich/root/42/info.xml /.snapshots/42
# ssh backups.example.com btrfs send /backups/eberich/root/42/snapshot | btrfs receive /.snapshots/42

If the system was reinstalled it is unfortunately in general not possibly to simply use the restored snapshot as the new default snapshot since some files, e.g. /etc/fstab, likely need modifications. Also unfortunately for other subvolumes than root a rollback is not supported. yeah that's rough, sorry bestie 😭

If there are snapshots on the source to speed up the operation you can also use the -p option for btrfs send. speedrun strats πŸƒβ™€οΈπŸ’¨


⭐ NOTES ⭐

The content of snapshots transferred must not be changed on the source system. Normally this is ensured since the snapshots are read-only. But it is possible to change snapshots to read-write. This can cause error during transfers in the future.

fr fr do not touch them. future you will be sobbing otherwise. πŸ’€

πŸ”₯ PERMISSIONS πŸ”₯

Since the target-mode ssh-push needs root permissions on the target it is recommended to use a dedicated machine or container as a target. give her her own little home, she deserves it 🏠✨


πŸ’– FILES πŸ’–

  • /etc/snapper/backup-configs β€” Directory containing configuration files.

πŸŽ€ EXIT STATUS πŸŽ€

Normally the exit status is 0. If an error occurred the exit status is 1. that's it, binary queen, no in-between πŸ‘‘


🌈 HOMEPAGE 🌈

http://snapper.io/


🫢 AUTHORS 🫢

Arvin Schnell <aschnell@suse.com>


πŸ‘‘ SEE ALSO πŸ‘‘

snapper-backup-configs(5), snapper(8), btrfs-send(8), btrfs-receive(8) rsync(1), sshfs(1)


πŸ“ NOTES πŸ“

  1. RFC 4180 https://tools.ietf.org/html/rfc4180

and that's the whole page bestie, you made it to the end πŸŽ‰ this was snbk version 0.13.0, dated 2024-11-05, and honestly? she ate. now go transfer some snapshots responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from