Reference

Script reference

Reference for all fsbackup scripts — what they do, where they live, and when they run.

Scripts run by systemd timers

ScriptLocationDescription
fs-runner.shbin/Core rsync snapshot runner. Takes ZFS snapshots for a class and tier.
fs-doctor.shbin/Health check: SSH reachability, source path existence.
fs-retention.shbin/Prunes old ZFS snapshots per KEEP_DAILY/WEEKLY/MONTHLY/ANNUAL.
fs-export-s3.shs3/Encrypts and uploads weekly/monthly/annual snapshots to S3.

Manual/admin utilities

ScriptLocationDescription
fs-restore.shutils/List and restore files from local ZFS snapshots.
fs-trust-host.shutils/Seeds SSH host keys for a remote host.
fs-provision.shbin/Creates ZFS datasets for all targets in targets.yml.
fs-fix-permissions.shbin/Sets ACLs on local source paths for the fsbackup user.
fs-schedule-apply.shbin/Writes OnCalendar= drop-ins for each timer from fsbackup.conf.

Scripts that run on remote hosts

ScriptLocationDescription
fsbackup_remote_init.shremote/Sets up the backup user on a remote source host.
fs-prometheus-prebackup.shremote/Takes a Prometheus API snapshot before backup runs.
fs-victoriametrics-prebackup.shremote/Takes a VictoriaMetrics API snapshot before backup runs.

fs-runner.sh flags

fs-runner.sh <tier> --class <class> [options]

  tier                  daily | weekly | monthly | annual
  --class <class>       class1 | class2 | class3
  --target <id>         Run for a single target only
  --dry-run             Print what would happen, make no changes
  --replace-existing    Force full re-sync (skips --ignore-existing)

fs-doctor.sh flags

fs-doctor.sh --class <class>

Output columns: TARGET, STAT (OK / WARN / FAIL), DETAIL.

fs-restore.sh flags

# List snapshots
fs-restore.sh list [--class <class>] [--id <target>]

# Restore a snapshot
fs-restore.sh restore \
  --class <class> \
  --id <target> \
  { --snapshot <name> | --latest [--type <tier>] } \
  --dest <path> \
  [--dry-run]

fs-retention.sh flags

fs-retention.sh [--dry-run]

Reads KEEP_DAILY, KEEP_WEEKLY, KEEP_MONTHLY, KEEP_ANNUAL from fsbackup.conf. KEEP_ANNUAL=0 means keep all annual snapshots indefinitely.

fs-provision.sh flags

fs-provision.sh [--dry-run] [--targets-file <path>]

Creates backup/snapshots/<class>/<target> ZFS datasets for all targets defined in targets.yml. Idempotent — skips datasets that already exist.