Article 5EH11 Logrotate - Variable needed for postrotate script

Logrotate - Variable needed for postrotate script

by
SammyC
from LinuxQuestions.org on (#5EH11)
I am using logrotate version 3.18.0 on Kali Linux, Debian kernel 5.3.9-3 and have need to use the rotated filename in a postrotate script. My logrotate configuration file uses the dateyesterday operator rather than a numeric character.

I am trying to determine whether logrotate populates a variable with the rotated filename so I can then use that variable within a postrotate script.

Here's what I envision:

logrotate performs actions on log file asa5510.log, the output file is asa5510.log-20210215.gz. I need to be able to pass filename "asa5510.log-20210215.gz" to a script; for example, if logrotate uses the variable $1 as the rotated filename, I'd use something similar to $RFILE=$1 in my postrotate bash script.

Any help would be greatly appreciated!latest?d=yIl2AUoC8zA latest?i=QJEVciJ6X6s:zI9msp1CCAU:F7zBnMy latest?i=QJEVciJ6X6s:zI9msp1CCAU:V_sGLiP latest?d=qj6IDK7rITs latest?i=QJEVciJ6X6s:zI9msp1CCAU:gIN9vFwQJEVciJ6X6s
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments