← 返回命令列表

Linux command

snapper 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Example

snapper list-configs

Create

snapper -c [config] create-config [path/to/directory]

Example

snapper -c [config] create -d "[description]"

List

snapper -c [config] list

Delete

snapper -c [config] delete [snapshot_number]

Example

snapper -c [config] delete [snapshot1]-[snapshot2]

Example

snapper -c [config] status [snapshot1]..[snapshot2]

Rollback

snapper -c [config] rollback [snapshot_number]

说明

snapper is a filesystem snapshot management tool primarily used with Btrfs. It creates, compares, and manages snapshots, enabling system rollback and file recovery. Snapper supports automatic snapshot timelines with configurable retention policies. Each configuration manages snapshots for a specific subvolume or logical volume. Snapshots can be created manually or automatically before/after system changes. The cleanup algorithms automatically remove old snapshots based on age or count limits.

参数

-c, --config _name_
Use specified configuration
list-configs
List all configurations
create-config _path_
Create new configuration for subvolume
delete-config
Delete a configuration
create
Create a new snapshot
delete _number_
Delete snapshot(s)
list
List snapshots
status _num1..num2_
Show changes between snapshots
diff _num1..num2_
Show file differences
undochange _num1..num2_ _files_
Undo changes between snapshots
rollback _number_
Rollback system to snapshot
cleanup _algorithm_
Run cleanup algorithm (number, timeline, empty-pre-post)
setup-quota
Set up quota (btrfs only)
-d, --description _text_
Snapshot description
-t, --type _type_
Snapshot type (single, pre, post)
-u, --userdata _key=value_
Set snapshot metadata
-s, --sync
Sync filesystem after delete

FAQ

What is the snapper command used for?

snapper is a filesystem snapshot management tool primarily used with Btrfs. It creates, compares, and manages snapshots, enabling system rollback and file recovery. Snapper supports automatic snapshot timelines with configurable retention policies. Each configuration manages snapshots for a specific subvolume or logical volume. Snapshots can be created manually or automatically before/after system changes. The cleanup algorithms automatically remove old snapshots based on age or count limits.

How do I run a basic snapper example?

Run `snapper list-configs` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c, --config _name_ do in snapper?

Use specified configuration