Bug#527060: logrotate: Automatically create "olddir"
Control: tags -1 moreinfo Does the configuration option "createolddir" suit your problem? Best regards Christian Göttsche
Bug#527060: logrotate: Automatically create olddir
Package: logrotate Version: 3.7.1-5 Severity: wishlist Hi, I guess this is more of a wish for upstream, but since I haven't been able to locate any bug tracker or even website for upstream, I'll report here. Currently, logrotate supports the olddir options, for moving rotated logfiles to a separate directory. Logrotate insists that this directory to rotate to exists when checking the configuration file. If the dir does not exist, it errors out with an error like: error: rsyslog-central:23 error verifying olddir path /data/log/rsyslog/log/apps/archive: No such file or directory I would suggest for logrotate to automatically create this directory if it does not exist yet (probably configurable with a createolddir option or something similar). This automatic creation is needed to support my dynamic logging environment: I have syslog files for different hosts, each of which have their own olddirs. Since directories for new hosts can be created at any time, I can't statically create the olddirs, so autocreation of these dirs would be needed (though I just realized that a script like for i in /foo/*; do mkdir -p $i/archive; done would also do the trick, though it is slightly less elegant...) Gr. Matthijs -- Package-specific info: Contents of /etc/logrotate.d total 20 -rw-r--r-- 1 root root 84 2008-06-08 14:28 apt -rw-r--r-- 1 root root 79 2008-07-04 18:56 aptitude -rw-r--r-- 1 root root 111 2008-06-18 10:11 dpkg -rw-r--r-- 1 root root 330 2009-05-05 10:17 rsyslog -rw-r--r-- 1 root root 836 2009-05-05 13:27 rsyslog-central -- System Information: Debian Release: 5.0.1 APT prefers stable APT policy: (990, 'stable') Architecture: i386 (i686) Kernel: Linux 2.6.22.19-vs2.2.0.7-grsec2.1.11-vs2.2.0.7 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages logrotate depends on: ii base-passwd 3.5.20 Debian base system master password ii cron 3.0pl1-105 management of regular background p ii libc6 2.7-18 GNU C Library: Shared libraries ii libpopt0 1.14-4 lib for parsing cmdline parameters ii libselinux1 2.0.65-5 SELinux shared libraries Versions of packages logrotate recommends: ii bsd-mailx [mailx] 8.1.2-0.20071201cvs-3 A simple mail user agent logrotate suggests no packages. -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#527060: logrotate: Automatically create olddir
though I just realized that a script like for i in /foo/*; do mkdir -p $i/archive; done would also do the trick, though it is slightly less elegant... Scratch that... logrotate verifies the olddir directly after reading a config entry, so long before any scripts are run... Gr. Matthijs signature.asc Description: Digital signature
Bug#527060: logrotate: Automatically create olddir
On Tue, May 05, 2009 at 01:58:59PM +0200, Matthijs Kooijman wrote: This automatic creation is needed to support my dynamic logging environment: I have syslog files for different hosts, each of which have their own olddirs. Since directories for new hosts can be created at any time, I can't statically create the olddirs, so autocreation of these dirs would be needed (though I just realized that a script like for i in /foo/*; do mkdir -p $i/archive; done would also do the trick, though it is slightly less elegant...) Surely when you're creating the conffile fragment for logrotate to use, you can also make the corresponding olddir directory? -- Paul Martin p...@debian.org -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#527060: logrotate: Automatically create olddir
Hi Paul, Surely when you're creating the conffile fragment for logrotate to use, you can also make the corresponding olddir directory? Nope, since I use wildcards: /data/log/rsyslog/*/*/*.log { ... olddir archive } Here, the dir structure is like: /data/log/rsyslog/mail/facilities/auth.log /data/log/rsyslog/mail/facilities/cron.log /data/log/rsyslog/dns/facilities/auth.log etc, where mail and dns are hostnames. I can't use a single olddir here (ie, an absolute path) either, since then I expect the identical filenames to create problems... I hope this clarifies my situation a bit! Gr. Matthijs signature.asc Description: Digital signature
Bug#527060: logrotate: Automatically create olddir
On Tue, May 05, 2009 at 03:53:44PM +0200, Matthijs Kooijman wrote: Hi Paul, Surely when you're creating the conffile fragment for logrotate to use, you can also make the corresponding olddir directory? Nope, since I use wildcards: /data/log/rsyslog/*/*/*.log { ... olddir archive } My suggestion would be that the directory is automatically created only when the olddir is specified as a directory within the log file's directory (ie. no slashes), and that it should inherit the ownership and permissions of its parent directory. -- Paul Martin p...@debian.org signature.asc Description: Digital signature
Bug#527060: logrotate: Automatically create olddir
Hi Paul, My suggestion would be that the directory is automatically created only when the olddir is specified as a directory within the log file's directory (ie. no slashes), and that it should inherit the ownership and permissions of its parent directory. That sounds pretty reasonable. Gr. Matthijs signature.asc Description: Digital signature