Since v1.4.0, Longhorn supports recurring jobs backup and restore along with the volume backup and restore. When restoring a backup volume, if users enable the setting, the original recurring jobs of the volume will be restored back accordingly.
For more information on the setting Restore Volume Recurring Jobs
, refer to the section.
When restoring a volume with recurring jobs, Longhorn will restore them together. If the volume name already exists, the volume and the recurring jobs will not be restored. If the recurring job name already exists but the spec is different, the restoring recurring job will be created with a randomly generated name to avoid conflict. Otherwise, Longhorn will try to reuse existing recurring jobs instead if they are the same as restoring recurring jobs of a backup volume.
By default, Longhorn will not automatically restore volume recurring jobs, users can enable the automatic restoration by Longhorn UI or kubectl.
- Navigate to the Setting menu and click General
- Navigate to the Backup menu
- Select the backup(s) you wish to restore and click Restore Latest Backup.
- In the Name field, select the volume you wish to restore.
Via Command Line
Users can override the setting by the volume spec property spec.restoreVolumeRecurringJob
.
- ignored. This is the default option that instructs Longhorn to inherit from the global setting.
- enabled. This option instructs Longhorn to restore volume recurring jobs from the backup target forcibly.
- disabled. This option instructs Longhorn no restoring volume recurring jobs should be done.
Result: The restored volume recurring jobs are available on the RecurringJob page.