Reference

Script reference

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

Scripts run by supercronic / systemd

ScriptLocationDescription
fs-runner.shbin/Core rsync snapshot runner. Takes snapshots for a class and tier.
fs-doctor.shbin/Health check: SSH reachability, source path existence, orphan detection, annual immutability.
fs-promote.shbin/Promotes daily snapshots to weekly (Monday) and monthly (1st of month).
fs-annual-promote.shbin/Promotes December monthly snapshot to annual. Runs January 5.
fs-retention.shbin/Prunes old snapshots on primary storage: 14d daily, 8w weekly, 12m monthly.
fs-mirror.shbin/Mirrors primary snapshots to secondary drive. Runs in daily or promote mode.
fs-mirror-retention.shbin/Prunes old snapshots on mirror: 14d daily, 12w weekly, 24m monthly.
fs-db-export.shbin/Dumps a database via docker exec before backup runs.
fs-export-s3.shs3/Encrypts and uploads weekly/monthly/annual snapshots to S3.

Manual/admin utilities

ScriptLocationDescription
fs-restore.shutils/Restore files from a local snapshot to a destination.
fs-trust-host.shutils/Seeds SSH host keys for a remote host.
fs-nodeexp-fix.shutils/Repairs node_exporter textfile collector permissions.
fs-annual-mirror-check.shutils/Verifies annual snapshots are synced to the mirror.
fs-target-rename.shutils/Renames a target across all snapshot tiers.

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 (ignore --ignore-existing)

fs-doctor.sh flags

fs-doctor.sh --class <class>

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

fs-restore.sh flags

fs-restore.sh \
  --class <class> \
  --target <id> \
  --tier <tier> \
  --date <date> \
  --dest <path> \
  [--to-host <hostname>] \
  [--dry-run]