STARTcloud Scripts packages the operational shell scripts STARTcloud runs on its Debian and Proxmox hosts. The package installs them under /opt/prominic/bin and ships a cron template for each.
A ksh script that takes a ZFS snapshot of a dataset from cron and keeps only a set number of them. Deletion is skipped while a scrub or resilver is running.
Snapshoter.sh [options] [zfs path]
-p <prefix> prefix for the snapshot name, defaults to 'snapshot'
-r recurse, snapshot every child dataset
-n # number of snapshots to keep, 0 keeps all, defaults to 0
-q run any quiesce/unquiesce scripts found under the path before and after the snapshot
-V print the version and exit
-h print the help and exit
Snapshots are named <zfs path>@<prefix>-YYYYMMDD-HHMM. With -r, destroys recurse too.
Originally written by A. Hettinger for prominic/OmniosScripts.
-
Download the latest release:
wget https://github.com/STARTcloud/startcloud-scripts/releases/latest/download/startcloud-scripts_VERSION_amd64.deb
-
Install the package:
sudo gdebi -n startcloud-scripts_VERSION_amd64.deb
The package depends on
ksh93u+mandzfsutils-linux. -
Enable the schedules you want:
Uncomment the lines for the pools the host carries in
/etc/cron.d/snapshoter. The file is a conffile, so upgrades keep your edits.
For detailed packaging and build instructions, see packaging/README.md.
Hourly snapshots of Array-0/vms and every child, keeping 24:
/opt/prominic/bin/Snapshoter.sh -p hourly -r -n 24 Array-0/vmsThe installed cron template carries hourly (keep 24), daily (keep 8) and weekly (keep 5) lines for Array-0/vms, Array-1/vms and Array-2/vms.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/your-feature-name). - Open a pull request.
This project is licensed under the GPL-3.0 License. See the LICENSE.md file for details.