Logrotate Question

Marcos Trazzini mstrazzini at gmail.com
Fri Jun 13 19:19:32 UTC 2008


(...)
>  Thanks, but it got the same error.
>
OK, let's try some other approach, as olddir option seems to bypass
parsing some shell commands. I believe that the following example
should work, and with some small modifications can turn you log
rotator much more flexible:

---- CUT HERE ----

/tmp/*.log {
       daily
       postrotate
			BASEDIR="/opt/netlogs/live"
			DEST="/opt/`date +%Y/%m/%d`"
			/bin/mkdir -p $DEST
			/usr/bin/find $BASEDIR -type f -name '*.log.1' -exec mv {} $DEST/ \;
       endscript
       sharedscripts
       missingok
}

---- CUT HERE ----

Rgds
>
>
>
>
>
>
>
>
>
>
>> --
>> redhat-list mailing list
>> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
>> https://www.redhat.com/mailman/listinfo/redhat-list
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>



-- 
Marcos S. Trazzini => mstrazzini at gmail.com




More information about the redhat-list mailing list