auto snapshots with zfs plugin

  • Hello

    i was waiting for btrfs support in openmediavault but it does not seem under way
    so i am switching my NAS from ext4 to ZFS which seems to be quite stable to what i hear

    (actually i have EXT4 drive and in parallel a copy of dataset with ZFS)

    up to now i am happy about the transfer

    I have one question about the usage of snapshot
    i have seen how to create a snapshot

    but i would like to know if there is any easy way in the ZFS plugin to create the snapshot automatically on schedule (maybe in the beta version)
    also to check errors it is necessary to launch some check/repaire command on a regular base ?

  • I use following for daily snapshot by cron:

    /sbin/zfs snapshot -r pool_name/dataset@AutoD-`date +"%F"`

    and "auto delete" after 7 days:

    /sbin/zfs list -t snapshot -o name | /bin/grep pool_name/dataset@AutoD- | /usr/bin/sort -r | /usr/bin/tail -n +7 | /usr/bin/xargs -n 1 /sbin/zfs destroy -r
  • maybe a nice feature of the ZFS plugin would be an interface to create those task easily

    I have been considering this, but it's extremely difficult to create a "general and intuitive" interface that at the same time needs to be specific... For now I won't add any such feature (and rather point to cron), but if someone can come up with a nice solution and send a pull request on GitHub I'm definitely willing to consider it.

  • That creates the proper cron jobs I guess?

    In cron tab added following

    # autosnapshot
    0 */1 * * * root /usr/local/sbin/autosnapshot >/dev/null 2>&1



    daily data auto-%Y%m%d-%H0000 false * * 2000 0000 30d 2678400
  • any update on adding this to the GUI?

    There has been no progress in adding this to the gui.

    omv 5.6.13 usul | 64 bit | 5.11 proxmox kernel | omvextrasorg 5.6.2 | kvm plugin 5.1.6 plugins source code and issue tracker - github

    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • I have an issue with autocleaning snapshots.

    Cronjob creates daily snapshot:

    /sbin/zfs snapshot -r Storage/backup@backup_`date +"%F"`

    Cronjob to check age of snapshot and deletes it after 30 days:

    /sbin/zfs list -t snapshot -o name | /bin/grep Storage/backup@backup_ | /usr/bin/sort -r | /usr/bin/tail -n +30 | /usr/bin/xargs -n 1 /sbin/zfs destroy -r

    running this job gives me

    is the missing argument because of there are no snapshots older than 30 days or is there another syntax mistake?

    Chaos is found in greatest abundance wherever order is being sought.
    It always defeats order, because it is better organized.
    Terry Pratchett

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!