snapm-schedule.d - Man Page

snapm schedule configuration files

Synopsis

/etc/snapm/schedule.d/*.json

Description

Files in /etc/snapm/schedule.d are loaded during the initialisation of snapm and describe user-defined snapshot set creation schedules on the local machine.

The files are structured in JSON format and are not generally intended to be manually edited: the snapm schedule create command creates these files according to the command line arguments given by the user.

Structure

A valid schedule file consists of a single JSON object describing the schedule:

{
    "name": "hourly",
    "sources": [
        "/",
        "/var"
    ],
    "default_size_policy": "25%SIZE",
    "autoindex": true,
    "calendarspec": "hourly",
    "boot": true,
    "revert": true,
    "gc_policy": {
        "policy_name": "hourly",
        "policy_type": "COUNT",
        "keep_count": 2
    }
}

Keys

The following keys are defined at the top level.

name

A JSON string: the name of this schedule, used for display and as the basename for snapshot sets.

sources

A JSON array (list): a list of mount point or block device paths to include in the snapshot sets created by this schedule, optionally including a size policy suffix.

default_size_policy

A JSON string: a default size policy to apply to all sources in sources for which no explicit size policy was specified.

autoindex

A JSON boolean indicating whether snapshot sets created by this schedule should use the --autoindex argument.

calendarspec

A JSON string containing a systemd calendar event expression indicating when this schedule should trigger snapshot set creation. See systemd.time(7).

boot

A JSON boolean indicating whether snapshot sets created by this schedule should use the --bootable argument to create bootable snapshot sets.

revert

A JSON boolean indicating whether snapshot sets created by this schedule should use the --revert argument to create a failsafe revert boot entry.

gc_policy

A JSON object describing the garbage collection policy for this schedule. The object always contains the two keys policy_name and policy_type, both of which accept a JSON string value. The first is a human readable name for the policy — normally the same as the schedule name — and the second selects a policy type via one of the values ALL, COUNT, AGE, or TIMELINE. Following these two keys are policy-type specific parameters. Each parameter has a policy defined name and a JSON integer number value.

ALL

The ALL policy type takes no parameters. All snapshot sets are retained until manually deleted.

COUNT

The COUNT policy type accepts a single parameter, keep_count indicating the maximum number of snapshot sets to retain.

AGE

The AGE policy type accepts four parameters: keep_years, keep_months, keep_weeks, keep_days. Snapshots that are more recent than the sum of these values are retained.

TIMELINE

The TIMELINE policy implements a more complex strategy. Snapshot sets are classified according to when they were taken, so for example, the first snapshot set in any given hour is considered an "hourly snapshot set", the first snapshot set after midnight on any given day is considered a "daily snapshot set" and so on. The TIMELINE policy type accepts up to six parameters: keep_hourly, keep_daily, keep_weekly, keep_monthly, keep_quarterly, keep_yearly which each accept a count argument. Up to count snapshot sets are retained for each classification.

Authors

Bryn M. Reeves <bmr@redhat.com>

See Also

snapm(8), systemd.time(7),
Snapm project page: https://github.com/snapshotmanager/snapm

Referenced By

snapm(8).

Jun 15 2025 Linux FILE FORMATS MANUAL