createolddir
jajator opened this issue · comments
whenever olddir is specified and not existing, i get this error:
Process-Local-Block : Skipping over processing log C:\logs\log.log. At C:\Program Files\WindowsPowerShell\Modules\Log-Rotate\public\Log-Rotate.ps1:207 char:13 Process-Local-Block -block $block @blockoptions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Process-Local-Block
createolddir does nothing, adding firstaction..mkdir..endscript
doesnt work because firstaction seems to be executed after that error message.
Can someone please shed some light on whats happening here and how I can create olddir if its not existing?
I believe the behavior of olddir
is to not run if the directory is absent in the original logrotate
utility.
So you'll have to create the directory before running. Note that you may also use an absolute path for olddir
.