canasta backup schedule set

From canasta

canasta > backup > backup schedule > set

canasta backup schedule set

Set a recurring backup schedule

Synopsis

Schedule recurring backups using a cron expression. The cron expression follows the standard 5-field format minute hour day-of-month month day-of-week.

This writes a crontab entry on the host where the instance runs (the instance's host for Compose, the control-plane node for Kubernetes) that runs canasta backup create -i <id> --tag scheduled on the schedule; output goes to backup.log in the instance directory. canasta must be installed on that host — on a remote or Kubernetes instance, set it up first with canasta install canasta -H <host>.

Give any of the retention flags to chain canasta backup purge after each backup, so old snapshots are pruned without a separate maintenance run. They are the flags canasta backup purge accepts and mean the same thing, so a policy that can be purged by hand can be scheduled. With no retention flag, nothing is purged and snapshots accumulate.

--purge-older-than is an older spelling of --keep-within; give one or the other, not both.

The schedule is persisted to config/backup-schedule.yml (captured by backups, re-materialized on restore). Setting a new schedule replaces the existing crontab entry in place; duplicates aren't created.

canasta backup schedule set [flags] CRON_EXPRESSION

Examples

canasta backup schedule set '0 2 * * *'
canasta backup schedule set '0 3 * * *' --keep-within 30d
canasta backup schedule set '37 3 * * *' --keep-daily 7 --keep-weekly 4

Arguments

Argument Description Default Required Orchestrator
CRON_EXPRESSION Cron expression for the schedule Both

Flags

Flag Shorthand Description Default Required Orchestrator
--id -i Canasta instance ID * Both
--keep-daily Number of daily backups to keep Both
--keep-hourly Number of hourly backups to keep Both
--keep-last Number of most recent backups to keep Both
--keep-monthly Number of monthly backups to keep Both
--keep-tag Keep backups that have this tag Both
--keep-weekly Number of weekly backups to keep Both
--keep-within Keep all backups made within this duration (e.g. 30d, 6m) Both
--keep-yearly Number of yearly backups to keep Both
--purge-older-than Older spelling of --keep-within Both

* Defaults to the Canasta instance matching the current directory, if any.

Global flags

Flag Shorthand Description Default Required Orchestrator
--help -h Show help message and exit Both
--verbose -v Enable verbose output Both