Hello,
I’ve got a cron job set up to manually trim my NVME pools once a week.
This works fine. (It has to run as root since I’m invoking zpool.)
However, on success, it doesn’t send me an email , because zpool trim doesn’t print anything to the standard output when it succeeds.
I’m not very good at shell scripting yet, at least when it comes to conditional statements and working with return codes from commands.
Can anyone recommend how to write a simple script that I can run in place of the raw zpool trim command that will run the trim, and then print a message to the standard output when the trim succeeds? As long as it prints something, I should get an email when it works.
Also, where is the best place to put such a script so it can be run as root?
