Plans

Configuring backup plans

A plan defines what to back up, where to store it, and when to run. Plans are the core scheduling unit in Valvet.

Creating a Plan

Navigate to Plans → Create Plan or use the API. A plan requires:

FieldRequiredDescription
NameYesHuman-readable name
NodeYesTarget node to run the backup on
RepositoryYesDestination restic repository
PathsYesOne or more directories to back up
ScheduleNoCron expression for automatic runs
ExcludesNoGlob patterns to skip
RetentionNoSnapshot retention policy
Pre-hooksNoCommands to run before backup
Post-hooksNoCommands to run after backup

Schedule

Schedules use standard 5-field cron expressions:

┌───────── minute (0-59)
│ ┌─────── hour (0-23)
│ │ ┌───── day of month (1-31)
│ │ │ ┌─── month (1-12)
│ │ │ │ ┌─ day of week (0-7, 0 and 7 = Sunday)
│ │ │ │ │
* * * * *

Examples:

  • 0 2 * * * — Every day at 2:00 AM
  • 0 */6 * * * — Every 6 hours
  • 30 1 * * 0 — Every Sunday at 1:30 AM
  • 0 3 1 * * — First of every month at 3:00 AM

Plans without a schedule can only be triggered manually via the “Run Now” button.

Retention Policy

Retention defines how many snapshots to keep. Restic’s forget command is run after each backup with the configured policy:

FieldExampleMeaning
Keep Last7Keep the 7 most recent snapshots
Keep Daily7Keep one snapshot per day for 7 days
Keep Weekly4Keep one per week for 4 weeks
Keep Monthly12Keep one per month for 12 months
Keep Yearly2Keep one per year for 2 years

Hooks

Pre-hooks run before the backup starts, post-hooks run after (regardless of success or failure). Common uses:

  • Pre-hook: Database dump, stop a service, create a consistent snapshot
  • Post-hook: Restart a service, send a notification, clean up temp files

Hooks are shell commands executed on the node.

Plan Duplication

You can duplicate an existing plan from the plan detail page. This creates a copy with all the same settings, ready to be modified (useful for setting up similar backups on different nodes).