man(8)

NAME
yabsnap - manage scheduled btrfs snapshots

SYNOPSIS
usage: main.py [-h] [--sync] [--config-file CONFIGFILE]
               [--source SOURCE] [--dry-run]
               {list,create,create-config,delete,rollback-gen} ...

DESCRIPTION
yabsnap is a btrfs snapshot manager.

GLOBAL OPTIONS

  yabsnap -h
View the inbuilt help.

  yabsnap ... -h
View the inbuilt help for a particular command.

  yabsnap --verbose ...
Enables info loging to trace certain parts of the code on the terminal.

  yabsnap --dry-run ...
Applicable to commands which create or delete snapshots.

  yabsnap --sync ...
Returns only after all btrfs operations finish. Applicable to commands which create or delete snapshots.

  yabsnap --config-file CONFIG-FILE ...
Use a specified config file, instead of scanning the directory /etc/config/yabsnap for configs.

  yabsnap --source SOURCE ...
Restricts to the config which has the specified source, for example `--source /home`. The source must be specified in one of the config files. Alternatively, a config-file directly may also be specified with `--config-file CONFIG-FILE`.

COMMANDS

  yabsnap create-config CONFIG_NAME
Bootstraps a new configuration in /etc/yabsnap/configs/CONFIG_NAME.conf. The config is an ini file with directives that control yabsnap schedule and triggers. Minimally after the config is created, the source and dest_prefix must be filled in by editing the file manually.

  yabsnap list
Lists all existing snapshots managed by yabsnap.

  yabsnap list-json
Produces a machine-readable list of all snapshots managed by yabsnap, outputting the data in JSONL (JSON Lines) format. This format is useful for further processing or automation. For example, you can pipe the output to tools like `jq` to filter or manipulate the data:
  $ yabsnap list-json | jq Tip: In nushell, you can use `... | from json --objects` to read JSONL.

  yabsnap [--dry-run] [--sync] create [--comment COMMENT]
Creates a new backup for all configs. Can be disabled per config by setting `keep_user = 0`.

  yabsnap set-ttl TARGET_SUFFIX --ttl TTL
Set a TTL (or Time-To-Live) for matching snapshots. The TTL argument must be a number followed by a time unit, e.g. '1 day' or '2 months'. To erase a TTL, pass an empty string, e.g. `yabsnap set-ttl TARGET_SUFFIX --ttl ''`. If a snapshot has a TTL, it will be automatically deleted soon after the TTL expires. Snapshots with TTL will be exempt from any other automated operations.

  yabsnap [--dry-run] [--sync] delete TARGET_SUFFIX
Deletes a snap. You can either specify full path to snapshot, e.g. `yabsnap delete /.snapshots/@root-20221006183032`, or specify just the suffix, e.g. `yabsnap delete 20221006183032`. If you specify just the suffix, it will delete matching snapshots from all configs.

  yabsnap [--dry-run] [--sync] batch-delete [--start TIMESTAMP] [--end TIMESTAMP] [--indicator S|I|U]
Batch delete snapshots. All snaps with start <= snap.time < end, optionally matching the `--indicator` will be deleted. Matching snapshots will be displayed and confirmed interactively before deletion.

  yabsnap [--dry-run] rollback-gen TARGET_SUFFIX [--subvol-map SUBVOL_MAP]
Generates a script to roll back to a particular snapshot. It can be redirected to a file with `... > rollback.sh`. It can also be executed with `... | bash`, but this is not advisable since it deny a chance to view or review the script. --subvol-map SUBVOL_MAP An advanced option used to override automatic detection of subvolumes during rollback. The `SUBVOL_MAP` must be specified in this format: `"MOUNT_DIR:SUBVOL_NAME ..."`. Example usage:
  $ yabsnap rollback-gen 20251104163041 --subvol-map "/:@ /home:@home" When this option is used, the generated script will include a comment confirming the override. This option is particularly relevant for rolling back snapshots taken before version `v2.3.0`. Earlier versions did not store subvolume names with snapshots, and instead detected them based on mount points of directories like `"/"` or `"/home"`. While this worked for online rollbacks (where the subvolumes were mounted consistently with the snapshot), it failed in offline environments where subvolumes could be mounted differently (e.g., mounting`/@.snapshots/@root-20250921193009` as root, when the actual subvolume to roll back is `@`). For snapshots taken **after** `v2.3.0`, this option is no longer necessary, as the subvolume names are now stored with the snapshots.

  yabsnap [--dry-run] rollback TARGET_SUFFIX [--subvol-map SUBVOL_MAP] [--noconfirm]
Generates and a rollback script, executes it after interactively confirming. If [--noconfirm] is passed, the interactive confirmation is skipped.

  yabsnap tui
Start the TUI.

BUGS
Please see or raise issues at: https://github.com/hirak99/yabsnap/issues

SEE ALSO
btrfs(8)