snapm - Man Page
Linux Snapshot Manager
Synopsis
Command Types
snapm [global_args] snapset create|create-scheduled|delete|rename|revert|resize|split|prune|activate|deactivate|autoactivate|list|show
snapm [global_args] snapshot activate|deactivate|autoactivate|list|show
snapm [global_args] plugin list
snapm [global_args] schedule create|delete|edit|enable|disable|list|show|gc
Subcommands
snapm snapset create [-b|--bootable] [-r|--revert] [-s|--size-policy policy] [-a|--autoindex] [--json] name source[size_policy]...
snapm snapset create-scheduled -c|--config schedule_name [--json]
snapm snapset delete [name|UUID] [-n|--name name] [-u|--uuid UUID]
snapm snapset rename old_name new_name
snapm snapset revert [name|UUID] [-n|--name name] [-u|--uuid UUID]
snapm snapset resize [name|UUID] [-n|--name name] [-u|--uuid UUID] [-s|--size-policy policy] [source[size_policy]...]
snapm snapset split name new_name source...
snapm snapset prune name source...
snapm snapset activate [name|UUID] [-n|--name name] [-u|--uuid UUID]
snapm snapset deactivate [name|UUID] [-n|--name name] [-u|--uuid UUID]
snapm snapset autoactivate --yes|--no [name|UUID] [-n|--name name] [-u|--uuid UUID]
snapm snapset list [name|UUID] [-n|--name name] [-u|--uuid UUID] [--name-prefixes|--nameprefixes] [--no-headings|--noheadings] [-o|--options fields] [-O|--sort sort_fields] [--rows|--json] [--separator separator]
snapm snapset show [name|UUID] [-n|--name name] [-u|--uuid UUID] [--members] [--json]
snapm snapshot activate [name|UUID] [-n|--name name] [-u|--uuid UUID] [-N|--snapshot-name name] [-U|--snapshot-uuid UUID]
snapm snapshot deactivate [name|UUID] [-n|--name name] [-u|--uuid UUID] [-N|--snapshot-name name] [-U|--snapshot-uuid UUID]
snapm snapshot autoactivate --yes|--no [name|UUID] [-n|--name name] [-u|--uuid UUID] [-N|--snapshot-name name] [-U|--snapshot-uuid UUID]
snapm snapshot list [name|UUID] [-n|--name name] [-u|--uuid UUID] [-N|--snapshot-name name] [-U|--snapshot-uuid UUID] [--name-prefixes|--nameprefixes] [--no-headings|--noheadings] [-o|--options fields] [-O|--sort sort_fields] [--rows|--json] [--separator separator]
snapm snapshot show [name|UUID] [-n|--name name] [-u|--uuid UUID] [-N|--snapshot-name name] [-U|--snapshot-uuid UUID] [--json]
snapm plugin list [--name-prefixes|--nameprefixes] [--no-headings|--noheadings] [-o|--options fields] [-O|--sort sort_fields] [--rows|--json] [--separator separator]
snapm schedule create -p|--policy-type policy_type [-b|--bootable] [-C|--calendarspec calendarspec] [-r|--revert] [-s|--size-policy policy] [--keep-count count] [--keep-years years] [--keep-months months] [--keep-weeks weeks] [--keep-days days] [--keep-yearly yearly] [--keep-quarterly quarterly] [--keep-monthly monthly] [--keep-weekly weekly] [--keep-daily daily] [--keep-hourly hourly] schedule_name source[size_policy]...
snapm schedule delete schedule_name
snapm schedule edit [-p|--policy-type policy_type] [-b|--bootable] [-C|--calendarspec calendarspec] [-r|--revert] [-s|--size-policy policy] [--keep-count count] [--keep-years years] [--keep-months months] [--keep-weeks weeks] [--keep-days days] [--keep-yearly yearly] [--keep-quarterly quarterly] [--keep-monthly monthly] [--keep-weekly weekly] [--keep-daily daily] [--keep-hourly hourly] schedule_name [source[size_policy]...]
snapm schedule enable schedule_name [--start]
snapm schedule disable schedule_name
snapm schedule list [--name-prefixes|--nameprefixes] [--no-headings|--noheadings] [-o|--options fields] [-O|--sort sort_fields] [--rows|--json] [--separator separator]
snapm schedule show schedule_name [--json]
snapm schedule gc -c|--config schedule_name
Description
snapm is a snapshot manager for Linux systems. It manages snapshots taken at a common moment in time as a snapshot set ("snapset").
Options
- -a | --autoindex
When creating snapshot sets treat name as a common basename and generate and append a new, non-negative index value, to create a unique instance name.
This is useful when creating recurring snapshot sets of the same set of sources, for example to create a timeline of snapshots for recovery and revert purposes.
- -b | --bootable
When creating snapshot sets automatically create a snapshot boot entry for the set.
- -C | --calendarspec calendarspec
Calendar event expression used to trigger scheduled creation of snapshot sets. See systemd.time(7) for the expression syntax.
- -c | --config schedule_name
The name of a configured schedule.
- -d | --debug debug_flags
A comma-separated list of subsystem names to enable debugging output for, or 'all' to enable all debugging. The available debug classes are: manager, command, report, schedule.
- -h | --help
Display usage information and exit.
- --json
Produce output in JSON notation. See the JSON Output section.
- --keep-count count
Retain count snapshot sets when applying the COUNT garbage collection policy.
- --keep-years years
Retain years snapshot sets when applying the AGE garbage collection policy.
- --keep-months months
Retain months snapshot sets when applying the AGE garbage collection policy.
- --keep-weeks weeks
Retain weeks snapshot sets when applying the AGE garbage collection policy.
- --keep-days days
Retain days snapshot sets when applying the AGE garbage collection policy.
- --keep-yearly yearly
Retain yearly yearly snapshot sets when applying the TIMELINE garbage collection policy.
- --keep-quarterly quarterly
Retain quarterly quarterly snapshot sets when applying the TIMELINE garbage collection policy.
- --keep-monthly monthly
Retain monthly monthly snapshot sets when applying the TIMELINE garbage collection policy.
- --keep-weekly weekly
Retain weekly weekly snapshot sets when applying the TIMELINE garbage collection policy.
- --keep-daily daily
Retain daily daily snapshot sets when applying the TIMELINE garbage collection policy.
- --keep-hourly hourly
Retain hourly hourly snapshot sets when applying the TIMELINE garbage collection policy.
- --members
Include individual snapshots in the output of snapset show commands.
- -n | --name name
Specify a snapshot set name to operate on.
- --name-prefixes | --nameprefixes
Add a 'SNAPM_' prefix plus the field name to the output. Useful with --noheadings to produce a list of field=value pairs that can be used to set environment or shell variables.
- --no-headings | --noheadings
Suppress output of report headings.
- -o | --options fields
Specify which fields to display.
- -O | --sort sort_fields
Specify which fields to sort by.
- -p | --policy-type policy_type
Select the garbage collection policy applied to snapshot sets created by a schedule. Valid values are ALL, COUNT, AGE, and TIMELINE.
- -r | --revert
When creating snapshot sets automatically create a snapshot revert entry for the set.
- --rows
Output report columns as rows.
- --separator separator
Report field separator.
- -s | --size-policy size_policy
Specify a default size policy when creating snapshot sets.
- -N | --snapshot-name name
Specify a snapshot name to operate on.
- -U | --snapshot-uuid UUID
Specify a snapshot UUID to operate on.
- --start
Start the specified schedule immediately when enabling it with snapm schedule enable.
- -u | --uuid UUID
Specify a snapshot set UUID to operate on.
- -v | --verbose
Increase verbosity level. Specify multiple times, or set additional debug classes with --debug to enable more verbose messages.
- -V | --version
Display the version of snapm and exit.
Identifier arguments
Commands that accept an identifier may use either a positional name or UUID , or the explicit options -n | --name and -u | --uuid (with snapshot variants -N | --snapshot-name and -U | --snapshot-uuid ). These forms are mutually exclusive. Mixing positional and explicit arguments in the same invocation is a parse error; in this case the command exits with status 2.
Snapshot Sets and Snapshots
The snapm command manages named collections of snapshots taken at a common point in time as snapshot sets. A snapshot set is created from a list of sources (mount point or block device paths) and allows the state of the system to be captured spanning over several volumes.
Valid characters for snapshot set names are: a–z A–Z 0–9 + . -
The underscore character ('_') is not permitted.
Snapshot sets and snapshots are also identified by a unique UUID value.
A plugin model is used to map mount points or devices onto possible snapshot providers. A provider plugin must exist for each source path specified when creating a snapshot set. The current plugins support LVM2 copy-on-write, LVM2 thin provisioned and Stratis snapshots.
The snapset subcommand allows snapshot sets to be created, deleted, enumerated, renamed, reverted, and activated or deactivated.
The snapshot subcommand provides access to information describing individual snapshots that are part of a snapshot set, for example the device path and snapshot status.
Snapshot set and snapshot status
Snapshots from different providers may exist in several possible states: Active, Inactive, Invalid, or Reverting.
Some providers allow snapshots to be in an Active or Inactive state and snapshots for some providers (for example LVM2 Copy-on-Write snapshots) have a specific size for the snapshot data store. If this space is completely consumed the snapshot becomes Invalid and can no longer be accessed.
When a revert is executed for a snapshot set that is currently mounted the status of the snapshot set is Reverting. If the snapshot set is in use (either the origin or snapshot volumes are mounted) the revert will take place the next time the volumes making up the snapshot set are activated and the snapshot set status will remain Reverting until the operation is complete.
The status of a snapshot set is an aggregation of the status of the individual snapshots it contains: if any snapshots are Invalid then the overall status of the snapshot set is also Invalid. If any snapshots within the set are Reverting then the snapshot set status as a whole is also Reverting. Finally, if any snapshots are Inactive then the status of the snapshot set is Inactive.
Snapshot size policies
An optional size policy hint can be specified when creating a snapshot set, either as a global default or individually for each source path. The policy is used at creation time to check that sufficient space is present.
For snapshot providers that require a fixed space to be allocated for the snapshot the policy is used to determine the size of the snapshot backing store.
There are currently four types of size policy that can be used to specify the space required:
- FIXED
A fixed size with optional unit suffix (MiB, GiB, TiB, etc.).
- %FREE
A percentage of the free space available from 0 to 100%.
- %USED
A percentage of the space currently consumed on the mount point, as reported by df. Values greater than 100% can be used to allow the existing content to be completely overwritten without running out of space. This policy can only be applied to snapshot sources that correspond to mounted file systems.
- %SIZE
A percentage of the size of the origin volume from 0 to 100%.
The default size policy for mounted volumes if none is specified is 200%USED. The default size policy for unmounted block devices is 25%SIZE.
Commands
Snapshot manager commands consist of a type (snapset, snapshot, plugin, schedule), followed by a type-specific subcommand.
Snapshot Set Commands
- snapm
snapset create [-b|--bootable] [-r|--revert] [-s|--size-policy policy] [-a|--autoindex] [--json] name source[size_policy]...
Create a new snapshot set using the specified list of mount points and block devices.The newly created snapshot set is displayed on the terminal on success:
# snapm snapset create backup / /home /var /opt /srv SnapsetName: backup Sources: /, /home, /var, /opt, /srv NrSnapshots: 5 Time: 2024-12-05 17:46:12 UUID: 87c89914-51a5-5043-8513-667100213243 Status: Inactive Autoactivate: no Bootable: noWhen creating snapshot sets --bootable and --revert can optionally be used to automatically create snapshot boot and revert boot entries respectively.
A size policy can be specified on the create command line, either as a global default or individually for each source path. To specify a default policy use the --size-policy argument. To specify a per-source path size policy append the policy to the source path separated by the : character:
# snapm snapset create backup --size-policy 25%FREE /:4G /home /var
SnapsetName: backup
Sources: /, /home, /var
NrSnapshots: 3
Time: 2024-12-05 17:47:19
UUID: 4106d5b5-b521-504d-8822-8826594debb5
Status: Inactive
Autoactivate: no
Bootable: noSnapshot providers that do not allocate a fixed size for snapshot data will check for available space according to the policy at creation time but do not enforce a fixed size for individual snapshots: space is allocated from the available pool on an as-needed basis.
If the --autoindex argument is given the name given on the command line is treated as a basename and a new, non-negative integer index will be generated and appended to the name to construct a new, unique instance name. This can be used to group a series of snapshot sets of the same set of sources that are taken on a recurring schedule.
# snapm snapset create hourly --autoindex /:5%SIZE /var:5%SIZE
SnapsetName: hourly.3
Sources: /, /var
NrSnapshots: 2
Time: 2025-03-26 14:17:18
UUID: ae082452-7995-5316-ac65-388eadd9879c
Status: Active
Autoactivate: yes
Bootable: no- snapm
snapset create-scheduled -c|--config schedule_name [--json]
Create scheduled snapshot sets according to named configuration. This command is normally called by the corresponding schedule timer. It may be issued manually for testing or debugging purposes, or to create additional snapshot sets not specified by the schedule parameters.- snapm
snapset delete [name|UUID] [-n|--name name] [-u|--uuid UUID]
Delete the specified snapshot set. The snapshot set to delete may be specified either by its name or UUID.- snapm
snapset rename old_name new_name
Rename an existing snapshot set. The snapshot set to be renamed is specified as old_name and the new name is given as new_name.- snapm
snapset revert [name|UUID] [-n|--name name] [-u|--uuid UUID]
Revert an existing snapshot set, re-setting the content of the origin volumes to the state they were in at the time the snapshot set was created. The snapshot set to be reverted may be specified either by its name or UUID.Reverting a snapshot set with mounted and in-use origin volumes will schedule the revert to take place the next time that the volumes are activated, for example by booting into a configured revert boot entry for the snapshot set.
- snapm
snapset resize [name|UUID] [-n|--name name] [-u|--uuid UUID] [-s|--size-policy policy] [source[size_policy]...]
Resize the members of an existing snapshot set, re-applying size policies to one or more of the snapshots making up the set. The snapshot set to resize may be specified by either its name or UUID.For snapshot providers that require a fixed space to be allocated to the snapshot this command will physically resize the corresponding snapshot according to the given size policy (lvm2-cow). For snapshot providers that dynamically allocate space the command will check that the requested space is available at the time of the resize command. An error is returned if the specified size policies cannot be satisfied.
Size policies may be specified on a per-source basis using the same syntax as the snapset create command. A default size policy can be set using the --size-policy argument. If no source paths are specified the command applies the default size policy to each member of the snapshot set.
The lvm2-cow plugin does not support shrinking snapshots, as this is not supported by the LVM2 tools.
- snapm
snapset split name new_name source...
Split snapshots from an existing snapshot set into a new snapshot set.Split the snapshot set named name into a new snapshot set named 'new_name'. Each listed source from 'name' is split into the new snapshot set. Sources that are not listed on the command line remain part of the original snapshot set. It is an error to split all sources from a snapshot set: in this case use 'snapm snapset rename' instead.
- snapm
snapset prune name source...
Prune snapshots from an existing snapshot set.Prune the listed sources from the snapshot set named name. The listed snapshot sources are pruned from the snapshot set and permanently deleted. This operation is irreversible.
It is an error to prune all sources from a snapshot set: in this case use 'snapm snapset delete' instead.
- snapm
snapset activate [name|UUID] [-n|--name name] [-u|--uuid UUID]
Attempt to activate snapshots making up snapshot sets. If no argument is given the command will attempt to activate all snapshots of all snapshot sets present on the system. If a name or UUID is specified then only that snapshot set will be activated.Not all snapshot providers support optional activation for snapshot volumes: for these providers activate and deactivate have no effect on volume availability.
- snapm
snapset deactivate [name|UUID] [-n|--name name] [-u|--uuid UUID]
Attempt to deactivate snapshots making up snapshot sets. If no argument is given the command will attempt to deactivate all snapshots of all snapshot sets present on the system. If a name or UUID is specified then only that snapshot set will be deactivated.Not all snapshot providers support optional activation for snapshot volumes: for these providers activate and deactivate have no effect on volume availability.
- snapm
snapset autoactivate --yes|--no [name|UUID] [-n|--name name] [-u|--uuid UUID]
Enable or disable snapshot autoactivation for snapshot sets matching selection criteria. Some snapshot providers (lvm2-thin) support optional snapshot volume activation when activating resources for e.g. at boot time. The snapset autoactivate subcommand allows control of this behaviour for snapshot sets managed by snapm.- snapm
snapset list [name|UUID] [-n|--name name] [-u|--uuid UUID] [--name-prefixes|--nameprefixes] [--no-headings|--noheadings] [-o|--options fields] [-O|--sort sort_fields] [--rows|--json] [--separator separator]
Output a tabular report of snapshot sets.Displays a report with one snapshot set per line, containing fields describing the properties of the configured snapshot sets.
The list of fields to display is given with -o|--options as a comma separated list of field names. To obtain a list of available fields run 'snapm snapset list -o help'. If the list of fields begins with the '+' character the specified fields are appended to the default field list. Otherwise the given list of fields replaces the default set of report fields.
The --rows, --noheadings, and --nameprefixes options can be used to generate output in a machine readable form, suitable for setting shell or environment variables.
Report output may be sorted by multiple user-defined keys using the --sort option. The option expects a comma separated list of keys, with optional + and - prefixes indicating ascending and descending sort for that field respectively.
- snapm
snapset show [name|UUID] [-n|--name name] [-u|--uuid UUID] [--members] [--json]
Display snapshot sets matching selection criteria on standard out. If the --members option is given individual snapshots are included in the output.
Snapshot Commands
- snapm
snapshot activate [name|UUID] [-n|--name name] [-u|--uuid UUID] [-N|--snapshot-name name] [-U|--snapshot-uuid UUID]
Attempt to activate individual snapshots matching selection criteria. If no argument is given the command will attempt to activate all snapshots of all snapshot sets present on the system. If a snapshot or snapshot set name or UUID is specified then only matching volumes will be activated.Not all snapshot providers support optional activation for snapshot volumes: for these providers activate and deactivate have no effect on volume availability.
- snapm
snapshot deactivate [name|UUID] [-n|--name name] [-u|--uuid UUID] [-N|--snapshot-name name] [-U|--snapshot-uuid UUID]
Attempt to deactivate individual snapshots matching selection criteria. If no argument is given the command will attempt to deactivate all snapshots of all snapshot sets present on the system. If a snapshot or snapshot set name or UUID is specified then only matching volumes will be deactivated.
Not all snapshot providers support optional activation for snapshot volumes: for these providers activate and deactivate have no effect on volume availability.
- snapm
snapshot autoactivate --yes|--no [name|UUID] [-n|--name name] [-u|--uuid UUID] [-N|--snapshot-name name] [-U|--snapshot-uuid UUID]
Enable or disable snapshot autoactivation for individual snapshots matching selection criteria. Some snapshot providers (lvm2-thin) support optional snapshot volume activation when activating resources for e.g. at boot time. The snapshot autoactivate subcommand allows control of this behaviour for individual snapshots managed by snapm.- snapm
snapshot list [name|UUID] [-n|--name name] [-u|--uuid UUID] [-N|--snapshot-name name] [-U|--snapshot-uuid UUID] [--name-prefixes|--nameprefixes] [--no-headings|--noheadings] [-o|--options fields] [-O|--sort sort_fields] [--rows|--json] [--separator separator]
Output a tabular report of snapshots.Displays a report with one snapshot per line, containing fields describing the properties of the configured snapshots.
The list of fields to display is given with --options as a comma separated list of field names. To obtain a list of available fields run 'snapm snapshot list -o help'. If the list of fields begins with the '+' character the specified fields are appended to the default field list. Otherwise the given list of fields replaces the default set of report fields.
The --rows, --noheadings, and --nameprefixes options can be used to generate output in a machine readable form, suitable for setting shell or environment variables.
Report output may be sorted by multiple user-defined keys using the --sort option. The option expects a comma separated list of keys, with optional + and - prefixes indicating ascending and descending sort for that field respectively.
- snapm
snapshot show [name|UUID] [-n|--name name] [-u|--uuid UUID] [-N|--snapshot-name name] [-U|--snapshot-uuid UUID] [--json]
Display snapshots matching selection criteria on standard out.
Plugin Commands
- snapm
plugin list [--name-prefixes|--nameprefixes] [--no-headings|--noheadings] [-o|--options fields] [-O|--sort sort_fields] [--rows|--json] [--separator separator]
Output a tabular report of plugins.
Displays a report with one plugin per line, containing fields describing the properties of the available plugins.
The list of fields to display is given with --options as a comma separated list of field names. To obtain a list of available fields run 'snapm plugin list -o help'. If the list of fields begins with the '+' character the specified fields are appended to the default field list. Otherwise the given list of fields replaces the default set of report fields.
The --rows, --noheadings, and --nameprefixes options can be used to generate output in a machine readable form, suitable for setting shell or environment variables.
Report output may be sorted by multiple user-defined keys using the --sort option. The option expects a comma separated list of keys, with optional + and - prefixes indicating ascending and descending sort for that field respectively.
Schedule Commands
- snapm
schedule create -p|--policy-type policy_type [-b|--bootable] [-C|--calendarspec calendarspec] [-r|--revert] [-s|--size-policy policy] [--keep-count count] [--keep-years years] [--keep-months months] [--keep-weeks weeks] [--keep-days days] [--keep-yearly yearly] [--keep-quarterly quarterly] [--keep-monthly monthly] [--keep-weekly weekly] [--keep-daily daily] [--keep-hourly hourly] schedule_name source[size_policy]...
Create a new snapshot set schedule.Create a persistent schedule to automatically create snapshot sets according to the name and arguments given to the snapm schedule create command.
Scheduled snapshot sets are created with the autoindex argument enabled, to ensure uniqueness of the created snapshot set names.
New snapshot sets will be automatically created as configured by the specified calendar event expression (--calendarspec).
The snapm schedule create command accepts the same set of arguments as the snapm snapset create command (with the exception of --autoindex, which is always enabled for scheduled snapshot set creation) and these are passed on to the snapshot sets created by the schedule.
A garbage collection policy specified by the --policy-type and configured by the corresponding --keep-* arguments is applied to automatically delete snapshot sets that are no longer required.
Newly created schedules are automatically enabled and will begin creating snapshot sets at the first expiry of the configured calendar expression.
# snapm schedule create --policy-type count --keep-count 2 --bootable --revert --size-policy 25%SIZE --calendarspec hourly hourly / /var Name: hourly Sources: /, /var DefaultSizePolicy: 25%SIZE Calendarspec: hourly Boot: yes Revert: yes GcPolicy: Name: hourly Type: Count Params: keep_count=2 Enabled: yes Running: yes NextElapse: 2025-08-23 04:00:00- snapm
schedule delete schedule_name
Delete snapshot set schedule.Delete an existing snapshot set schedule by name. The specified schedule is disabled and removed from the system. Existing snapshot sets created by the schedule before its deletion remain and continue to be available until deleted by the user.
- snapm
schedule edit [-p|--policy-type policy_type] [-b|--bootable] [-C|--calendarspec calendarspec] [-r|--revert] [-s|--size-policy policy] [--keep-count count] [--keep-years years] [--keep-months months] [--keep-weeks weeks] [--keep-days days] [--keep-yearly yearly] [--keep-quarterly quarterly] [--keep-monthly monthly] [--keep-weekly weekly] [--keep-daily daily] [--keep-hourly hourly] schedule_name [source[size_policy]...]
Modify an existing snapshot set schedule.Modify a persistent schedule to automatically create snapshot sets according to the name and arguments given to the snapm schedule edit command. Arguments not specified on the edit command line are taken from the existing schedule.
The snapm schedule edit command accepts the same set of arguments as the snapm schedule create command.
If -p policy_type is provided without type-specific parameters, the existing policy is retained (except for the all policy type, which has no parameters and is applied directly).
- snapm
schedule enable schedule_name [--start]
Enable existing snapshot set schedule.Enable an existing snapshot set schedule by name. The specified schedule is enabled and will be started on subsequent reboots. To start the schedule timer immediately use --start.
- snapm
schedule disable schedule_name
Disable existing snapshot set schedule.Disable an existing snapshot set schedule by name. The specified schedule is stopped and disabled, and will no longer automatically start on subsequent reboots.
- snapm
schedule list [--name-prefixes|--nameprefixes] [--no-headings|--noheadings] [-o|--options fields] [-O|--sort sort_fields] [--rows|--json] [--separator separator]
Output a tabular report of configured schedules.Displays a report with one schedule per line, containing fields describing the properties of the configured schedules.
The list of fields to display is given with -o|--options as a comma separated list of field names. To obtain a list of available fields run 'snapm schedule list -o help'. If the list of fields begins with the '+' character the specified fields are appended to the default field list. Otherwise the given list of fields replaces the default set of report fields.
The --rows, --noheadings, and --nameprefixes options can be used to generate output in a machine readable form, suitable for setting shell or environment variables.
Report output may be sorted by multiple user-defined keys using the --sort option. The option expects a comma separated list of keys, with optional + and - prefixes indicating ascending and descending sort for that field respectively.
# snapm schedule list ScheduleName ScheduleSources SizePolicy OnCalendar Enabled NextElapse daily /, /var 10%SIZE daily yes 2025-08-25 00:00:00- snapm
schedule gc -c|--config schedule_name
Run garbage collection for snapshot set schedule.Run the configured garbage collection policy for the schedule specified with -c | --config schedule_name.
Cleans up snapshot sets created by schedule_name, applying the configured cleanup policy and parameters given to snapm schedule create.The names of deleted snapshot sets are printed to standard output.
Scheduling and Garbage Collection
Snapshot manager supports automatically creating snapshot sets according to a user-defined schedule. A garbage collection policy provides for automatically cleaning up snapshot sets that are no longer required according to a user defined policy and retention parameters.
Snapshot set schedules are created with the snapm schedule create command. The command accepts the same set of arguments as snapm snapset create allowing the properties of scheduled snapshot sets to be controlled by the user.
Garbage collection policies
- ALL
Retain all snapshot sets. This policy accepts no parameters and never deletes snapshot sets automatically.
- COUNT
Retain a fixed number of snapshot sets. This policy accepts a single parameter, --keep-count=count and retains up to count snapshot sets.
- AGE
Retain snapshot sets younger than specified age. This policy accepts up to four parameters (--keep-years=years, --keep-months=months, --keep-weeks=weeks, --keep-days=days) and retains snapshot sets that were created more recently than the specified age limit. The limit applied is the sum of the parameters given.
- TIMELINE
Retain snapshot sets according to classification. Each snapshot set is classified as hourly, daily, weekly, monthly, quarterly, or yearly according to its creation time: the first snapshot set taken at the beginning of each hour is classified as hourly, the first taken after midnight each day as daily, the first taken after midnight each Monday as weekly, and so on. A fixed number of snapshot sets is retained for each classification according to the value of the --keep-hourly, --keep-daily, --keep-monthly, --keep-quarterly, and --keep-yearly parameters.
Booting and Reverting Snapshot Sets
Snapshot manager integrates with the boom(8) boot manager to facilitate booting and reverting snapshot sets. Specifying the -b|--bootable or -r|--revert arguments when creating a snapshot set will cause snapm to create a snapshot boot or revert boot entry respectively.
The snapshot boot entry allows the system to boot into the state of the system at the time the snapshot was created. This can be used to inspect the previous state of the system or to quickly recover from a failed update or reconfiguration.
In order to reset the system back to the state at the time the snapshot set was created the revert boot entry is used after issuing a snapm snapset revert command. After running the revert command the system should be rebooted into the revert boot entry. This will start the revert operation on all affected volumes.
While the operation is in progress the snapshot set will appear with the status of Reverting.
Reverting a snapshot set will also destroy the snapshot set since the snapshot volumes are folded back into the origin devices. Following the completion of a revert operation the snapshot set will no longer appear in the output of snapm snapset list or snapm snapset show commands.
Reporting Commands
Both the snapset list and snapshot list commands use a common reporting system to display the results of the query. The selection of fields, and the order in which they are displayed may be controlled to produce custom report formats using the -o/--options argument. The report output can also be optionally sorted by one or more field values using the -O/--sort argument.
To display the available fields for a given report type use the special field name help:
# snapm snapset list -o help
Snapshot set Fields
-------------------
name - Snapshot set name [str]
UUID - Snapshot set UUID [UUID]
basename - Snapshot set basename [str]
index - Snapshot set index [idx]
timestamp - Snapshot set creation time as a UNIX epoch value [num]
time - Snapshot set creation time [time]
nr_snapshots - Number of snapshots [num]
sources - Snapshot set sources [strlist]
mountpoints - Snapshot set mount points [strlist]
devices - Snapshot set devices [strlist]
status - Snapshot set status [str]
autoactivate - Autoactivation status [str]
bootable - Configured for snapshot boot [str]
bootentry - Snapshot set boot entry [sha]
revertentry - Snapshot set revert boot entry [sha]Report Fields
The snapm reports provide several types of field that may be added to the default field set for either snapshot set or snapshot reports, or used to create custom reports.
Snapshot sets
Snapshot set fields provide information about snapshot sets as a whole, including the name, number of snapshots, mount points, status and UUID.
- name
The name of this snapshot set.
- UUID
The UUID of this snapshot set.
- basename
The basename of this snapshot set.
- index
The index of this snapshot set, or the special value '-' if this snapshot set does not have recurring instances.
- timestamp
The snapshot set creation time as a UNIX epoch value.
- time
The snapshot set creation time as a human readable string.
- nr_snapshots
The number of snapshots contained in this snapshot set.
- sources
The list of sources (devices or mount points) contained in this snapshot set.
- mountpoints
The list of mount points contained in this snapshot set.
- devices
The list of block devices contained in this snapshot set.
- status
The current status of this snapshot set. See the Snapshot set and snapshot status section.
- autoactivate
The autoactivation setting for this snapshot set.
- bootentry
The boot identifier of the boot loader entry configured to boot this snapshot set, or the empty string if no boot entry has been created.
- revertentry
The boot identifier of the boot loader entry configured to revert this snapshot set following a merge operation, or the empty string if no revert boot entry has been created.
Snapshots
Snapshot fields provide information about the snapshots that make up snapshot sets, including the fields available in the snapshot set report as well as fields specific to individual snapshots.
- snapshot_name
The provider-specific name used to refer to the snapshot.
- snapshot_uuid
The snapshot UUID.
- origin
The origin volume that this snapshot refers to.
- mountpoint
The path to the mount point where this snapshot was taken from.
- devpath
The provider-specific path to the device used to mount this snapshot.
- provider
A string representing the snapshot provider plugin used to create this snapshot.
- status
The current status of this snapshot. See the Snapshot set and snapshot status section.
- size
The size of the snapshot as a human readable string.
- free
The amount of free space available to the snapshot as a human readable string.
- size_bytes
The size of the snapshot in bytes.
- free_bytes
The amount of free space available to the snapshot in bytes.
- autoactivate
Whether this snapshot is configured for autoactivation.
Plugins
- name
Name of the plugin.
- version
Version of the plugin.
- type
The snapshot type created by this plugin.
Schedules
Schedule fields provide access to information on configured schedules and the recurring snapshot sets they create.
- name
Name of the schedule.
- sources
Schedule sources.
- sizepolicy
Schedule default size policy.
- autoindex
Schedule autoindex.
- gcpolicytype
Schedule garbage collection policy type.
- gcpolicyparams
Schedule garbage collection policy parameters.
- oncalendar
Schedule OnCalendar trigger expression.
- nextelapse
Time of next elapse.
- enabled
Schedule enabled.
- running
Schedule running.
JSON Output
All reporting commands can optionally generate output in JSON notation by using the --json argument. The output is a JSON object containing a key for the object type (Snapsets, Snapshots, Plugins, or Schedules) that contains a JSON array of objects of the specified type.
Reporting commands use JSON key names derived from the report field names. For list reports the JSON keys are always prefixed with the object type to avoid collisions (e.g., snapset_name). The -o/--options and -O/--sort arguments accept those report field names (prefixes are optional unless required to disambiguate).
Selection and sorting is controlled with --options and --sort as usual:
# snapm snapset list --json -o+snapset_uuid --sort snapset_time
{
"Snapsets": [
{
"snapset_name": "before-upgrade",
"snapset_time": "2025-09-08 18:43:57",
"snapset_nr_snapshots": 2,
"snapset_status": "Active",
"snapset_sources": [
"/",
"/var"
],
"snapset_uuid": "6330328b-a9d0-5b41-ac96-53b371449965"
},
{
"snapset_name": "backup",
"snapset_time": "2025-09-09 17:12:21",
"snapset_nr_snapshots": 3,
"snapset_status": "Inactive",
"snapset_sources": [
"/",
"/home",
"/var"
],
"snapset_uuid": "efa8a09d-cf9c-500b-ad68-32c4a0e159b4"
}
]
}The create, create-scheduled, and show subcommands also support optional JSON notation using the --json argument. This includes the snapset, snapshot, and schedule show subcommands:
# snapm snapset show --json before-upgrade
[
{
"SnapsetName": "before-upgrade",
"Sources": [
"/",
"/home",
"/var"
],
"MountPoints": [
"/",
"/home",
"/var"
],
"Devices": [],
"NrSnapshots": 3,
"Timestamp": 1755915019,
"Time": "2025-08-23 03:10:19",
"UUID": "d9b63a58-333b-517a-b38d-7cc818040fab",
"Status": "Active",
"Autoactivate": true,
"Bootable": true,
"BootEntries": {
"SnapshotEntry": "61cb664",
"RevertEntry": "74c1cf2"
}
}
]The JSON format produced by the create and show commands uses JSON key names that reflect the property names used in the normal show command output. The output is a JSON array containing objects of the specified type.
When boot entries are defined for a snapshot set the resulting JSON will include a BootEntries object giving the corresponding boom boot_id values.
The create commands output a single JSON object of the corresponding type. The show commands produce a JSON array containing the selected objects.
Examples
List the available snapshot sets
# snapm snapset list
SnapsetName Time NrSnapshots Status Sources
backup 2024-12-05 17:53:10 4 Active /, /opt, /srv, /var
userdata 2024-12-05 17:53:22 2 Inactive /data, /homeList the available snapshots
# snapm snapshot list
SnapsetName Name Origin Source Status Size Free Autoactivate Provider
backup fedora/root-snapset_backup_1733421190_- /dev/fedora/root / Active 8.8GiB 8.8GiB yes lvm2-cow
backup fedora/var-snapset_backup_1733421190_-var /dev/fedora/var /var Active 6.4GiB 6.4GiB yes lvm2-cow
backup p1/fs2-snapset_backup_1733421190_-srv /dev/stratis/p1/fs2 /srv Active 2.0GiB 3.2GiB yes stratis
backup p1/fs1-snapset_backup_1733421190_-opt /dev/stratis/p1/fs1 /opt Active 1.0GiB 3.2GiB yes stratisList the available snapshots, displaying the basename and index for each
# snapm snapset list -o+basename,index
SnapsetName Time NrSnapshots Status Sources Basename Index
backup 2025-03-25 18:12:54 2 Invalid /, /var backup -
hourly.0 2025-03-26 14:00:00 2 Invalid /, /var hourly 0
hourly.1 2025-03-26 15:00:00 2 Active /, /var hourly 1
hourly.2 2025-03-26 16:00:00 2 Active /, /var hourly 2
hourly.3 2025-03-26 17:00:00 2 Active /, /var hourly 3Create a new snapshot set from the mount points /, /home, and /var
# snapm snapset create backup / /home /var
SnapsetName: backup
Sources: /, /home, /var
NrSnapshots: 3
Time: 2024-12-05 17:57:05
UUID: b9b4cd96-75a5-5826-a26b-b617c06bd877
Status: Active
Autoactivate: no
Bootable: noCreate a bootable snapshot set from the mount points /, /home, and /var
# snapm snapset create -br before-upgrade / /home /var
SnapsetName: before-upgrade
Sources: /, /home, /var
NrSnapshots: 3
Time: 2025-08-23 03:10:19
UUID: d9b63a58-333b-517a-b38d-7cc818040fab
Status: Active
Autoactivate: yes
Bootable: yes
BootEntries:
SnapshotEntry: 61cb664
RevertEntry: 74c1cf2Create a bootable snapshot set from the mount points /, /home, and /var, with output formatted in JSON notation
# snapm snapset create -br --json before-upgrade / /home /var
{
"SnapsetName": "before-upgrade",
"Sources": [
"/",
"/home",
"/var"
],
"MountPoints": [
"/",
"/home",
"/var"
],
"Devices": [],
"NrSnapshots": 3,
"Timestamp": 1755915019,
"Time": "2025-08-23 03:10:19",
"UUID": "d9b63a58-333b-517a-b38d-7cc818040fab",
"Status": "Active",
"Autoactivate": true,
"Bootable": true,
"BootEntries": {
"SnapshotEntry": "61cb664",
"RevertEntry": "74c1cf2"
}
}Delete the snapshot set named 'backup'
# snapm snapset delete backup
Activate all snapshot sets with verbose output
# snapm -v snapset activate
INFO - Activated 2 snapshot setsRename the snapshot set 'backup' to 'oldbackup'
# snapm snapset rename backup oldbackup
Display the snapshot set named 'before-upgrade'
# snapm snapset show before-upgrade
SnapsetName: before-upgrade
Sources: /, /home, /var
NrSnapshots: 3
Time: 2025-08-23 03:10:19
UUID: d9b63a58-333b-517a-b38d-7cc818040fab
Status: Active
Autoactivate: yes
Bootable: yes
BootEntries:
SnapshotEntry: 61cb664
RevertEntry: 74c1cf2Display the snapshot with UUID b201bdba-89b7-5014-a80d-f5d4b9a690ed
# snapm snapshot show -U b201bdba-89b7-5014-a80d-f5d4b9a690ed
Name: fedora/home-snapset_before-upgrade_1755915019_-home
SnapsetName: before-upgrade
Origin: /dev/fedora/home
Time: 2025-08-23 03:10:19
Source: /home
MountPoint: /home
Provider: lvm2-thin
UUID: b201bdba-89b7-5014-a80d-f5d4b9a690ed
Status: Active
Size: 1.0GiB
Free: 1.9GiB
Autoactivate: yes
DevicePath: /dev/fedora/home-snapset_before-upgrade_1755915019_-home
VolumeGroup: fedora
LogicalVolume: home-snapset_before-upgrade_1755915019_-homeExit Status
snapm exits with one of the following status codes:
- 0
Command completed successfully.
- 1
A runtime error occurred.
- 2
Invalid arguments or option parsing error.
Files
Configuration is read from the following locations:
/etc/snapm/snapm.conf
/etc/snapm/plugins.d
/etc/snapm/schedule.d
The main configuration file is /etc/snapm/snapm.conf. Plugin-specific settings are stored in plugins.d, and snapshot schedules are defined in schedule.d.
Bugs
Please report bugs via the GitHub issue tracker:
Authors
Bryn M. Reeves <bmr@redhat.com>
See Also
snapm.conf(5). snapm-plugins.d(5). snapm-schedule.d(5). systemd.time(7). boom(8). lvm(8). stratis(8).
⟨https://github.com/snapshotmanager/snapm⟩ snapm project page
⟨https://github.com/snapshotmanager/boom⟩ Boom project page
⟨https://www.sourceware.org/lvm2/⟩ LVM2 resource page
⟨https://stratis-storage.github.io/⟩ Stratis resource page