You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add ability for a user of this role to define a prerotate script that is run prior to the logrotation process.
Rationale
In the same way that logrotate provides the ability to run a script after a log has been rotated, it also provides a means by which a script can be run in advance. This functionality is used in my case to push log files off to an s3 bucket before rotation occurs.
prerotate/endscript
The lines between prerotate and endscript (both of which must appear on lines by themselves) are executed (using /bin/sh) before the log file is rotated and only if the log will actually be rotated. These directives may only appear inside a log file definition. Normally, the absolute path to the log file is passed as first argument to the script. If sharedscripts is specified, whole pattern is passed to the script. See also postrotate. See sharedscripts and nosharedscripts for error handling.
The text was updated successfully, but these errors were encountered:
danrough
added a commit
to danrough/ansible-role-logrotate
that referenced
this issue
May 23, 2024
Proposed feature
Add ability for a user of this role to define a prerotate script that is run prior to the logrotation process.
Rationale
In the same way that logrotate provides the ability to run a script after a log has been rotated, it also provides a means by which a script can be run in advance. This functionality is used in my case to push log files off to an s3 bucket before rotation occurs.
Additional context
prerotate is define in the manpage, here https://linux.die.net/man/8/logrotate
The text was updated successfully, but these errors were encountered: