Next: RC File Examples, Previous: Configuration parameters, Up: Top
In monthly/weekly/daily logs metavariables can be used. Metavariables are identifiers of a runtime defined value and can be used while using following parameters:
storedir storefile prerotate...endscript postrotate...endscript
List of handled metavariables:
@BASENAME.@NEXT_EXT
).
Values of metavariables are defined while the script is running, so a block definition like this
/var/adm/log.* { storedir /var/adm/archive-log/@BASENAME rotate 5 ... }
means that rottlog will rotate 5 times all files in /var/adm beginning with "log." and store each file in a dir named with logname. (i.e. /var/adm/archive-log/log.kern, /var/adm/archive-log/log.daemon...)
WARNING: Metavariables substitution is merely textual!
So in a block like this
/var/http/www.mysite.com/log/access.log { storefile @3-@13-@FILENAME rotate 4 .... }
rottlog will create logfiles called something like www.mysite.com-var3-access.log.1
Because @13 is not defined (complete absolute filename in first line of block definition contains only 5 tokens) and only @1 will be substituted. Following text will not be affected (remaining 3-) and will NOT generate an error code.