Prev: lenny 503 amd64 w/ Intel DP55WB NIC not detected
Next: Lenny is acting screwing after alsa sourcecode install
From: Sascha Silbe on 26 Sep 2009 06:10 Hi! I'd like logrotate to move old (compressed) logfiles to a directory on a different device (from SD card to hard disk in this case). Unfortunately the "olddir" config option only works if both directories are on the same device (probably for easier handling of the first rotate step). Lastaction would be an option, but then I'd need to duplicate the entire rotation / removal logic (configured per logfile). Maybe someone has a better idea? CU Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/
From: Frank Lin PIAT on 27 Sep 2009 07:30
On Sat, 2009-09-26 at 11:59 +0200, Sascha Silbe wrote: > ld (compressed) logfiles to a directory on a > different device (from SD card to hard disk in this case). > Unfortunately > the "olddir" config option only works if both directories are on the > same device (probably for easier handling of the first rotate step). That's probably to make sure that moving the file is immediate/atomic. > Lastaction would be an option, but then I'd need to duplicate the > entire rotation / removal logic (configured per logfile). This might still be an option, if you set "dateext" in logrotate (the old files are then named mylogfile.YYYYMMDD*) Then periodically run something like: cd /path/to/logs ; ls -1 mylog* | sort -r | sed '1,5d' | xargs echo rm (This assume you want to preserve the 5 last log files) Once you have tested it, you can replace "echo rm" with "rm" ;) > Maybe someone has a better idea? There are probably better ideas, but this quick hack should work. Regards, Franklin -- To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org |