Linux command
timeshift 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
List
sudo timeshift --list
Create
sudo timeshift --create --comments "[description]"
Create
sudo timeshift --create --tags D
Check
sudo timeshift --check
Restore
sudo timeshift --restore --snapshot '[snapshot_name]'
Restore
sudo timeshift --restore --snapshot '[snapshot_name]' --target-device [/dev/sda1]
Delete
sudo timeshift --delete --snapshot '[snapshot_name]'
Delete all
sudo timeshift --delete-all
说明
timeshift is a system restore utility for Linux that creates incremental snapshots of the filesystem using rsync or btrfs snapshots. It allows rolling back system changes while preserving user data. Similar to Windows System Restore or macOS Time Machine for system files.
参数
- --list
- List all snapshots.
- --list-devices
- List available devices.
- --check
- Create snapshot if one is scheduled.
- --create
- Create a new snapshot (even if not scheduled).
- --restore
- Restore a snapshot.
- --delete
- Delete a snapshot.
- --delete-all
- Delete all snapshots.
- --snapshot _NAME_
- Specify the snapshot to restore or delete.
- --comments _TEXT_
- Set snapshot description.
- --tags _{O,B,H,D,W,M}_
- Add tags to snapshot: Ondemand, Boot, Hourly, Daily, Weekly, Monthly (default: O).
- --target-device _DEVICE_
- Specify target device for restore.
- --grub-device _DEVICE_
- Specify device for installing GRUB2 bootloader.
- --skip-grub
- Skip GRUB2 reinstallation during restore.
- --snapshot-device _DEVICE_
- Specify backup device (default: from config).
- --btrfs
- Switch to BTRFS mode.
- --rsync
- Switch to RSYNC mode.
- --yes
- Answer YES to all confirmation prompts.
- --scripted
- Run in non-interactive mode.
FAQ
What is the timeshift command used for?
timeshift is a system restore utility for Linux that creates incremental snapshots of the filesystem using rsync or btrfs snapshots. It allows rolling back system changes while preserving user data. Similar to Windows System Restore or macOS Time Machine for system files.
How do I run a basic timeshift example?
Run `sudo timeshift --list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --list do in timeshift?
List all snapshots.