On Tue 24 Mar 2009, Paul Martin wrote: > > Your patch doesn't allow for multiple files to be notified to the script.
... which is exactly what I want, as if multiple files are rotated, postrotate is run once for each of those multiple files. (Which is the whole point of my bug report: the postrotate script is called for every individual eligible file (rotated or not, eg. due to notifempty), and there is no way of determining which file has just been rotated prior to the calling of the postrotate script.) With my modification, after file A is rotated, postrotate is called with LOGROTATED_FILE=A.1 in the environment. Then, after file B is rotated, postrotate is called with LOGROTATED_FILE=B.1 in the environment, and so on. > $1 = pattern > $2.. = rotated files Your modification might be useful in the lastaction script. Using it for postrotate will mean that after the first file is rotated, $2 contains the first file rotated. After the second file is rotated, $2 still contains the first file rotated, $3 now contains the second file rotated. And so on. In short, it'll be called like this: postrotate '/var/log/apache2/*.log' /var/log/apache2/access.log postrotate '/var/log/apache2/*.log' /var/log/apache2/access.log /var/log/apache2/error.log postrotate '/var/log/apache2/*.log' /var/log/apache2/access.log /var/log/apache2/error.log '' postrotate '/var/log/apache2/*.log' /var/log/apache2/access.log /var/log/apache2/error.log '' '' postrotate '/var/log/apache2/*.log' /var/log/apache2/access.log /var/log/apache2/error.log '' '' /var/log/apache2/vhost2-access.log postrotate '/var/log/apache2/*.log' /var/log/apache2/access.log /var/log/apache2/error.log '' '' /var/log/apache2/vhost2-access.log /var/log/apache2/vhost2-error.log The third and fourth invocations have empty arguments added as vhost1 didn't get any hits and hence those log files are empty, and thus not rotated :-) (However I think actually that with your current patch there won't be an empty argument, but rather the argument list will be permanently stopped there as rotnames[i]->finalName will be NULL in the case of a not-rotated file...) That simply doesn't make sense to me; as the postrotate script is run after every file, I want to know exactly that file and the rest isn't relevant. The usage I'm looking for is to be able to do something extra to the just rotated logfile (eg. analyze it, or archive it in another place in a way that isn't possible with the olddir directive, eg. place it in a YYYYMM directory). Paul -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org