2
rated 0 times
[
2]
[
0]
/ answers: 1 / hits: 431
/ 2 Years ago, tue, july 19, 2022, 3:03:55
I have a weekly script that cron runs to make a zfs snapshot. I was wondering if it is possible to mail a OK mail if the job run correctly and a error mail if something happened and in the content of the mail to have the job log. How to do this?
25 11 * * 5 /home/aegrimisu/ZFS-autosnapshot.sh>>/home/aegrimisu/ZFS-WeeklySnapShot.log 2>&1 | mail -s "ZFS SnapShot Status" [email protected]
The script content is :
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
zfs snapshot Misu@Misu-`date +%Y.%m.%d-%H:%m:%S`
More From » 12.04