An open API service indexing awesome lists of open source software.

https://github.com/farmergreg/zfs-auto-snapshot

Quickly schedule rolling Hourly/Daily/Weekly/Monthly snapshots of ZFS file systems
https://github.com/farmergreg/zfs-auto-snapshot

Last synced: 12 months ago
JSON representation

Quickly schedule rolling Hourly/Daily/Weekly/Monthly snapshots of ZFS file systems

Awesome Lists containing this project

README

          

ZAutoSnap Readme - Copyright (C) 2016 Greg Dietsche

OVERVIEW:
ZAutoSnap is a simple script that is meant to be used with cron
to take recursive snapshots of a zfs file system. All snapshots
have the time they were taken built into their name, so it is easy
to determine when the snapshot was taken.

Usage: zautosnap.sh zfsFileSystem SnapShotType [MaxSnapsToKeep]

zfsFileSystem
The file system that will be snapshotted.

SnapShotLabel
Chose a label for the snapshot (e.g. Daily)
This can be whatever you want it to be so long as it
is a single word.

MaxSnapsToKeep (optional parameter)
A number between 0 and infinity (or 42... Whichever comes first)

When this is NOT set, an unlimited number of snapshots will
be kept.

If you set this to zero, all snapshots matching SnapShotLabel
will be deleted.

Otherwise, MaxSnapsToKeep will make sure that only the
specified number of snapshots will be kept.

SAMPLE CRONTAB:
0 0 * * * zautosnap tank DAILY 30
0 0 1 * * zautosnap tank MONTHLY 3

SAMPLE SNAPSHOT:
When you run `zfs list -t snapshot` you'll see snapshots like this:
tank/iso@zautosnap_DAILY_2011-11-11_01:15:03

EXAMPLES:
zautosnap tank DAILY 0 #Remove all 'DAILY' snapshots from tank
zautosnap tank DAILY 30 #keep up to 30 'DAILY' snapshots
zautosnap tank DAILY #keep unlimited 'DAILY' snapshots

LICENSE:

The MIT License

Copyright (c) 2015 Gregory L. Dietsche

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.