I'm trying to pass a custom formatted date as part of the olddir
path in my logrotate configuration since I organize my archives chronologically (obviously!).
This is what I'm passing to olddir
:
olddir /path/to/archive/$(date --date='-1 day' +'%Y/%m-%b')/
Running logrotate -d
(debug mode) throws me this error :
error: /etc/logrotate.d/my-logrotate-config:15 bad olddir path /path/to/archive/$(date --date='-1 day' +'%Y/%m-%b')/
Is there some way I can pass the output of the date
command to the olddir
option?