A backup in Longhorn represents a volume state (a Snapshot) at a given time, stored in the secondary storage (backupstore in the Longhorn world) which is outside of the Longhorn system. Backup creation will involve copying the data through the network, so it will take time.
These operations happen automatically, but can also be done as needed.
A corresponding snapshot is needed for creating a backup. And user can choose to backup any snapshot previous created.
The user can setup a S3 or NFS type backupstore to store the backups of Longhorn volumes.
You can find an example containerized NFS server for testing purposes here.
Setup recurring snapshot/backup
Longhorn supports recurring snapshot and backup for volumes. User only need to set when they wish to take the snapshot and/or backup, and how many snapshots/backups needs to be retains, then Longhorn will automatically create snapshot/backup for the user at that time, as long as the volume is attached to a node.
Users can setup recurring snapshot/backup via Longhorn UI, or Kubernetes StorageClass.
Set up recurring jobs using Longhorn UI
User can find the settings for recurring snapshots and backup in the Volume Detail page.
Set up recurring jobs using StorageClass
Users can set field recurringJobs in StorageClass as parameters. Any future volumes created using this StorageClass will have those recurring jobs automatically set up.
Field recurringJobs should follow JSON format. e.g.