Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spookey/say_cheese_zfs
Automatically take and/or purge ZFS snapshots
https://github.com/spookey/say_cheese_zfs
Last synced: about 1 month ago
JSON representation
Automatically take and/or purge ZFS snapshots
- Host: GitHub
- URL: https://github.com/spookey/say_cheese_zfs
- Owner: spookey
- License: mit
- Created: 2018-09-09T16:42:51.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-02-04T23:14:21.000Z (11 months ago)
- Last Synced: 2024-10-19T17:28:51.421Z (3 months ago)
- Language: Python
- Size: 23.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Say cheese
==========Automatically take and/or purge ZFS snapshots.
Synopsis
--------This code is intended to be run inside the crontab.
It should work both in python 2 and python 3.
(If it does not, or on other errors, please feel free to open an issue.)Installation
^^^^^^^^^^^^* As long this is still work in progress, clone this repository (as non root)
into a trusted location.* Then symlink both scripts (as root) into a folder inside of ``$PATH``.
Crontab
^^^^^^^My crontab looks more or less like this::
# say cheese
3 0 * * * /usr/local/bin/python /location/of/take_snapshots.py auto_daily >> /var/log/say_cheese.log 2>&1
13 0 * * * /usr/local/bin/python /location/of/purge_snapshots.py 1 d -p auto_daily >> /var/log/say_cheese.log 2>&15 0 * * 0 /usr/local/bin/python /location/of/take_snapshots.py auto_weekly >> /var/log/say_cheese.log 2>&1
15 0 * * 0 /usr/local/bin/python /location/of/purge_snapshots.py 1 w -p auto_weekly >> /var/log/say_cheese.log 2>&17 0 1 * * /usr/local/bin/python /location/of/take_snapshots.py auto_monthly >> /var/log/say_cheese.log 2>&1
17 0 1 * * /usr/local/bin/python /location/of/purge_snapshots.py 1 m -p auto_monthly >> /var/log/say_cheese.log 2>&19 0 1 1 * /usr/local/bin/python /location/of/take_snapshots.py auto_yearly >> /var/log/say_cheese.log 2>&1
19 0 1 1 * /usr/local/bin/python /location/of/purge_snapshots.py 1 y -p auto_yearly >> /var/log/say_cheese.log 2>&1Scripts
-------Take
^^^^Take snapshots.
Please see ``./take_snapshots.py --help`` for usage::
./take_snapshots.py [-h] [-x] [-d] name [pools [pools ...]]
Purge
^^^^^Purge snapshots.
Please see ``./purge_snapshots.py --help`` for usage::
./purge_snapshots.py [-h] [-d] [-p PREFIX]
time
{S,sec,M,min,H,hour,d,day,w,week,m,month,y,year}Appendix
--------This project is loosely related to
`zfs-snapshot-all `_
and
`zfs-prune-snapshots `_
by bahamas10.I just wanted to solve the same problems, but in a little different way.
The changes are different enough that forking was not really an option.
Thanks for this original awesome work - it helepd a lot!
.. _ztake: https://github.com/bahamas10/zfs-snapshot-all
.. _zprune: https://github.com/bahamas10/zfs-prune-snapshots