logrotate вращает, сжимает и отправляет системные журналы по почте (logrotate ‐ rotates, compresses, and mails system logs)
Скрипты (Scripts)
The lines between the starting keyword (e.g. prerotate
) and
endscript
(both of which must appear on lines by themselves) are
executed (using /bin/sh
). The script inherits some traits from
the logrotate
process, including stderr, stdout, the current
directory, the environment, and the umask. Scripts are run as
the invoking user and group, irrespective of any su
directive.
If the --log
flag was specified, file descriptor 3 is the log
file. The current working directory is unspecified.