Skip to content

zfs auto-snapshot script which runs before package upgrade using Pacman hook

License

Notifications You must be signed in to change notification settings

acrion/zfs-autosnap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zfs-autosnap

This Arch Linux package automatically creates and manages ZFS snapshots before system upgrades. It is designed to protect your system by creating reliable snapshots prior to major package updates, triggered by a Pacman hook.

Features

  • Automatic ZFS snapshots
    Creates snapshots of a specified dataset before performing system upgrades.

  • Snapshot description tagging
    Lets you set a custom autosnap:description for easy identification of snapshots.

  • Automatic cleanup
    Deletes older snapshots beyond a user-defined limit to keep your snapshot history uncluttered.

  • Pacman lock file handling
    Temporarily removes the Pacman lock file (/var/lib/pacman/db.lck) to prevent it from being included in a ZFS snapshot.

  • Configurable behavior
    The /etc/zfs-autosnap.conf file allows you to enable or disable snapshot creation, set custom dataset names, limit the number of snapshots, and more.

Configuration

Edit /etc/zfs-autosnap.conf to match your preferences. For example:

  • skipAutosnap (boolean) – Set to true to skip snapshot creation.
  • dataset (string) – Your ZFS dataset name (default is ditana-root/ROOT/default).
  • snapshotDescription (string) – Custom description for identifying snapshots.
  • deleteSnapshots (boolean) – Enables or disables automatic deletion of older snapshots.
  • maxSnapshots (integer) – Maximum number of autosnap snapshots to keep.

Additional Information

For details on listing ZFS snapshots and performing rollbacks, see the Ditana GNU/Linux Best Practices.

Acknowledgments

Contributing

Contributions, suggestions, and bug reports are warmly welcomed! Feel free to open an issue or submit a pull request on GitHub.

About

zfs auto-snapshot script which runs before package upgrade using Pacman hook

Topics

Resources

License

Stars

Watchers

Forks

Languages