37 lines
1.1 KiB
Markdown
37 lines
1.1 KiB
Markdown
# README #
|
|
|
|
`zfs-auto-snapshot` automatically creates and rotates periodic snapshots of all ZFS filesystems and volumes.
|
|
The script automatically rotates snapshots by pruning older ones beyond the retention limit.
|
|
The script temporarily skips snapshots on damaged pools or pools with an active scrub.
|
|
|
|
It creates:
|
|
- 4 snapshots per hour (rotated every 15 minutes)
|
|
- 24 hourly snapshots
|
|
- 31 daily snapshots
|
|
- 12 weekly snapshots
|
|
- 12 monthly snapshots
|
|
|
|
Script is tested on Linux (AlmaLinux 9, CentOS/RHEL 7-9, OpenZFS 2.x / 0.8.x).
|
|
Originally adapted from https://github.com/zfsonlinux/zfs-auto-snapshot
|
|
|
|
## Installation
|
|
```sh
|
|
make install
|
|
```
|
|
|
|
## Uninstallation
|
|
```sh
|
|
make uninstall
|
|
```
|
|
|
|
> [!NOTE]
|
|
> Uninstalling the script does not delete existing snapshots.
|
|
|
|
## CLI Parameters
|
|
- `--keep`: Number of snapshots to preserve (default: 10).
|
|
- `--label`: Label tag for snapshots (default: `defaultLabel`).
|
|
- `--threshold`: Minimum bytes written to the dataset since the last snapshot to trigger a new one (default: 0).
|
|
- `--prefix`: Snapshot name prefix (default: `zfs-auto-snap`).
|
|
|
|
|