Score:0

How to configure autozsys, so that it doesn't destroy zfs snapshots older than X time?

in flag

I think that autozsys destroys snapshots older than a month and I'm wondering if it's possible to extend this (make it for example persist 3 months worth of snapshots).

I couldn't find any configuration file for autozsys, only a cron job in /etc/apt/apt.conf.d/90_zsys_system_autosnapshot, but I hoped for more sophisticated means to control it.

Daniel Krajnik avatar
in flag
I'm beginning to believe that users can't configure it that easily. [This](https://arstechnica.com/gadgets/2020/03/ubuntu-20-04s-zsys-adds-zfs-snapshots-to-package-management/#:~:text=according%20to%20age.-,The,-garbage%20collection%C2%A0ruleset) article mentions that zsys.conf exists, but it's editable only at the compile-time. I might have been wrong about the "garbage collection" though. It seems like zsys should only remove snapshots when there is 20% or less disk space left. Possibly these missing snapshots were deleted from my machines in some other way (oops)
guiverc avatar
cn flag
Ubuntu 21.04 (along with all flavors) is *End-of-Life* and thus unsupported on this site (https://askubuntu.com/help/on-topic), and many other Ubuntu sites, unless your question is specific to moving to a supported release of Ubuntu. https://fridge.ubuntu.com/2022/01/21/ubuntu-21-04-hirsute-hippo-end-of-life-reached-on-january-20-2022/ https://help.ubuntu.com/community/EOLUpgrades
Daniel Krajnik avatar
in flag
thanks, I'm going to update to 21.10 in a moment, just want to sort out one thing with a broken plasma configuration. Hopefully, it's unrelated to the crux of the question
Score:1
ru flag

To keep absolutely all automatic snapshots from the last 3 months, ensure gcStartAfter is set to 90 in /etc/zsys.conf. At minimum, the file would look as follows:

history:
  gcstartafter: 90

Once the file is saved, effect the change via:

zsysctl service reload

Source: a blog post by the author of ZSys, which is linked to by the ZSys GitHub repository in lieu of proper documentation: https://didrocks.fr/2020/06/04/zfs-focus-on-ubuntu-20.04-lts-zsys-state-collection/

Daniel Krajnik avatar
in flag
thanks, didn't even know that there can be zsys.conf
ru flag
Happy to help - you can mark this answer as "accepted" if you feel this answers your question.
Score:0
in flag

Zsys removes snapshots based on free space left (min. 20% by default), not time like I initially thought. My snapshots must have disappeared in some other, unrelated way.

Also it seems like configuration of zsys is done only at compile-time as hinted at the end of this article.

ru flag
Where did you find that ZSys removes snapshots based on space left on the device?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.