[syslog-ng] log-rotation: how to write rotated files to another directory

Balazs Scheidler bazsi at balabit.hu
Fri Nov 25 08:29:49 CET 2005


On Thu, 2005-11-24 at 07:01 -0800, Oliver Lang wrote:
> Hi list,
> 
> using the macros $MONTH, $WEEK and $DAY it is possible to rotate the
> logfiles. The rotated files are written to the defined working
> directory.
> 
> Question: Is it possible to define another directory for these rotated
> logs ??
> 
> The working directory should contain the current logfiles only. 

Not really, as including time related macros in the destination file
name is not really "rotation", it is simply generating destination file
names according to the macros in the name. You can implement something
similar with a script, e.g.

find /var/log -mtime 1 -exec mv '{}' /var/log/archive \;

-- 
Bazsi



More information about the syslog-ng mailing list