Periodic snapshot every month?

wingstar

Dabbler
Joined
Jan 4, 2014
Messages
10
Hi,
I would like to creare an periodic snapshot every month.
This seems not to be possible in the web gui, the biggest interval is 1 week.
Any idea?
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
What would be the purpose of this? A month doesn't seem that useful for correcting mistakes.

You could always schedule one with cron.
 

wingstar

Dabbler
Joined
Jan 4, 2014
Messages
10
What would be the purpose of this? A month doesn't seem that useful for correcting mistakes.
Well, my plan was to setup one of my dataset like this:
1. Periodic snapshot every day which gets deleted after 2-3 month.
2. Periodic snapshot every month which gets deleted after ~2 years.
3. Periodic snapshot one per year that is not deleted.
In my specific use case this is a suitable balance between used storage and being able to recover data.

You could always schedule one with cron.
I guess one can do that, I just don't understand why they have limited the possibility to do it in the place where you actually creates periodical snapshots.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
Until this limitation is overcome, you might be helped by a script that I wrote: zfs rollup

I think you could achieve what you want by setting your snapshot schedule to at least every day (if not more often) and then run the following pruning command at least once a day:

Code:
rollup.py --recursive --intervals 'daily:90,monthly:24,yearly:0' poolname


That will keep 90 daily snapshots (approximately 3 months worth), 24 monthly (two years worth), and unlimited yearly.

You can add --test to see what is going to happen without making any changes. Add --verbose to always see which snapshots are or would be removed.
 

elangley

Contributor
Joined
Jun 4, 2012
Messages
109
Until this limitation is overcome, you might be helped by a script that I wrote: zfs rollup

I think you could achieve what you want by setting your snapshot schedule to at least every day (if not more often) and then run the following pruning command at least once a day:

Code:
rollup.py --recursive --intervals 'daily:90,monthly:24,yearly:0' poolname


That will keep 90 daily snapshots (approximately 3 months worth), 24 monthly (two years worth), and unlimited yearly.

You can add --test to see what is going to happen without making any changes. Add --verbose to always see which snapshots are or would be removed.

I realize this is an old thread. This is something I want to do. Is this still the preferred method?
How exactly (step/by/step) do you setup the prune job?

TIA,

~eric
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
It's not included with FreeNAS, so you'd need to:
- download it from GitHub
- put it somewhere accessible on your FreeNAS box
- make it executable: chmod +x /full/path/to/rollup.py
- test it to get the right arguments that you want (figure out what prune schedule you want)
- add an entry to cron (use the /full/path/to/rollup.py)

Let me know if you have any issues. I hope it works out for you.
 
Top