in reply to How to instantaneously automatically save

Ok, so let me rephrase my question: How do I make a perl program that listens for whenever `zpool`and `zfs` command is used and saves it in database? Thanks in advance.
  • Comment on Re: How to instantaneously automatically save

Replies are listed 'Best First'.
Re^2: How to instantaneously automatically save
by Anonymous Monk on Jan 14, 2024 at 07:04 UTC
    EDIT: whenever `zpool` and `zfs`is used in the terminal

      The easiest way is to rename the zfs and zpool commands to something else (zfs.org?) and name your new programs zfs and zpool.

      Alternatively, set up shell aliases for the users using these commands.

      Alternatively, learn about what APIs ZFS offers to know about what zfs and zpool do or change, and listen to these API calls.

        Thank you very much, Corion. What I want is for my perl program to listen for whenever as soon as any change is made on the ZFS filesystem (if a dataset was created, if a clone was made, well any sort of change on the filesystem) save it immediately in database. So I will go by what you said in your last sentence, thanks again.