theohbrothers / Log-Rotate

A replica of the logrotate utility, except this also runs on Windows systems.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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?

commented

@jajator createolddir is not supported. Is it a new option in logrotate?

commented

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.