On 2023-05-10 21:33, Per Jessen wrote:
Carlos E. R. wrote:
That "preremove" option is pretty cool. Didn't exist when I set up our own log archiving almost twenty years ago :-)
It makes it easy and straight forward to do log archiving. Although it is yet another situation where you wish for MAILTO to work with systemd timers :-)
preremove /usr/local/bin/archive_logfile.sh $1 send_the_email $1 endscript
:-)
Huh? what is that supposed to do ? The MAILTO option in a cronjob would mail the errors and any other output from the log rotation. Yours seems to mail the logfile? logrotate has a direct option for that, "mail". Sorry, that you mail whatever you need by writing a script to do it all.
-- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)