Setting up ZFS Auto Snapshot on CentOS 7

Hello all -
I’m trying to configure ZFS auto snapshot from the offcial ZFS on Linux GIT repo, but so far I’ve only been able to get the “Frequent” or 15 minute incremental snapshot to work automatically, the other jobs only work on occasion by manually running their respective cron job. Is there anyone here who can help me finish configuring it? Able to provide additional information since I’ve sure it will be required. Thanks! -Freedomfighter91

if you’re on linux you’ll have a better time with the 3rd party tools like crontab right now

if you are snapshot’ing every 15 mins… how many do you keep?

Currently I’ve kept it at 4 while I work on the other snapshot tasks.

zfs snapshots don’t take up much space and they don’t degrade performance, in contrast to linux native/non block level filesystems. No reason not to go hog wild with em.

True, but I want to be able to use all the other snapshot tasks as well as frequent .

you said manually running the cron job makes the other snapshot tasks work right

so use crontab to automatically manually run them

I use a third party script on my NAS: https://github.com/khenderick/zfs-snap-manager

It supports more options and can automatically purge old snapshots. It hangs up sometimes and has to be restarted though so YMMV

OP is using https://github.com/zfsonlinux/zfs-auto-snapshot
This already uses cron for scheduling, and it also allows you to set how many of the frequent, hourly, daily, weekly and monthly snapshots you want to keep, deleting older ones.

To OP: are the zfs-auto-snapshot scripts present in the /etc/cron.{hourly,daily,weekly,monthly} directories?

Edit: do other hourly, daily, weekly and monthly cronjobs run without problems?

Only the script placed in the cron.d runs automatically without problems or having to be manually invoked with “run-part,” which is the frequent script that runs every 15 minutes and keeps 4 by default. The scripts all seem to be present in their appropriate directories. Although the properly working script in the cron.d folder looks different then the ones in the other folders that are not working properly for some reason, not sure if thats supposed to be the case by default.

Would you like me to post the contents of the scripts?

UPDATE: So after a few days working on a similar test configuration in a VM using CentOS 7 I believe I have found where the problem lies. I discovered that when the script tries to run it fails because the install location where the the main script is placed by default is incorrect for CentOS 7, as I discovered by looking through various webpages associated with the script’s github. Following input that was suggested by poster’s on said webpages, I added the correct PATH for the cron.d script frequent scripts as well as the other scripts. I have attached screenshots of the main and hourly scripts so that others with the same issue may benefit from them, and hopefully not go through the long search that I did to find the answer to this problem. In addition, it seems that this script is deprecated and needs a maintainer so if anyone is up to the task I’m sure it would be very welcomed by many. Thanks to all the other posters on this thread for your input and assistance, It was very much appreciated. d%20frequent%20zfs%20snapshot%20CentOS%207 d%20hourly%20zfs%20snapshot%20CentOS%207