dsh2dsh / zrepl

One-stop ZFS backup & replication solution (fork)
https://zrepl.github.io
MIT License
5 stars 2 forks source link

Feature: pre/post job hook #5

Open robertek opened 5 hours ago

robertek commented 5 hours ago

What I'm missing in zrepl is a command hook before some job starts and when finished.

To explain a scenario I use regularly.

  1. resume usb external drive
  2. import pool
  3. backup
  4. export pool
  5. suspend usb drive

I do this by external cronjob that do the steps and then signal zrepl to do the job. I need to wait for a fixed time (getting proper finish status from zrepl is hard) and then do the final steps to suspend the drives.

I can imagine something like:

  - name: "mpool-to-bpool"
    type: "push"
    connect:
      type: "local"
      listener_name: "bpool"
      client_identity: "localhost"
    filesystems: *filesystems
    hooks:
       pre: /some/path/resume_pool.sh
       post: /some/path/suspend_pool.sh
......

I'm not a go programmer, but I may try to look at it.

dsh2dsh commented 5 hours ago

That's good idea. I'll take a look.