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:

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


    and "auto delete" after 7 days:

    Code
    /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

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


    autosnapshot:



    autoshapshot.conf:


    Code
    daily data auto-%Y%m%d-%H0000 false * * 2000 0000 30d 2678400
    • Offizieller Beitrag

    any update on adding this to the GUI?

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

    omv 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I have an issue with autocleaning snapshots.


    Cronjob creates daily snapshot:

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



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

    Code
    /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

  • any update on adding this to the GUI? Will try the scripts given, but GUI would be nice. Was trying to use napp-it but it's scripts aren't working on OMV.

    I am also looking on how to do snapshots and rolebacks - This would indeed be great plugin to have in the GUI the option to make snapshots of whatever the user/owner wants (folders/sub folders etc etc...)

    There are, sometimes, many ways to do things/tasks, and experience with them will lead you to take the one you feel comfortable with.
    My test drives are on 2 machines both OMV with ZFS and with a 500gb laptop SYS BOOT HDD
    1. i7 920 with 12gb ram; 4x2tb sata WD purple
    2. ibm x3100 m4; 32gb ram; 4x6tb sas Seagate

  • maybe a nice feature of the ZFS plugin would be an interface to create those task easily

    It would be indeed be great to have the option to create snapshots and role back like they do it in Freenas/Truenas

    There are, sometimes, many ways to do things/tasks, and experience with them will lead you to take the one you feel comfortable with.
    My test drives are on 2 machines both OMV with ZFS and with a 500gb laptop SYS BOOT HDD
    1. i7 920 with 12gb ram; 4x2tb sata WD purple
    2. ibm x3100 m4; 32gb ram; 4x6tb sas Seagate

    • Offizieller Beitrag

    It would be indeed be great to have the option to create snapshots and role back like they do it in Freenas/Truenas

    openmediavault 6.3.0 will have that feature for BTRFS. But it does not have a restore feature by intention as mentioned in the PR. I do not like to have users running into this scenario like it is described for a different NAS. Scheduled snapshots are on the todo list.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!