On 2023-05-10 14:10, Per Jessen wrote:
Per Jessen wrote:
Carlos E. R. wrote:
preremove /usr/local/bin/archive_logfile.sh /var/log/testfile endscript } -------------------
It is not what you wish, but would do.
You are close, but no, it would not be called with the right arguments. There are two calls -
1) as above 2) with the oldest compressed archive
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 :-) -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)