Package: logrotate
Version: 3.7.1-3 
 
- System information:

# uname -a
Linux correo 2.6.18-6-amd64 #1 SMP Mon Oct 13 18:13:07 UTC 2008 x86_64 GNU/Linux

# dpkg -s libc6 | grep ^Version
Version: 2.3.6.ds1-13etch7

- Description:

When you configure logrotate with mailfirst option and delaycompress, the 
program dont send the log to the specific email address, because it looks at 
for a .gz file, which doesnt exits (It hasn´t been compressed yet).

It´s something about this in this closed bugreport:
  
Refer: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=186818 
 
- Bug reprodution:

* Edit /etc/logrotate.conf and add this lines with a real format email address:
 
/var/log/mail.log {
        dateext
        mailfirst
        mail janzun.rosanegra dt rosanegra dt org
        missingok
        daily
        rotate 365
        create
        compress
        delaycompress
        start 0
} 
 
* Executing logrotate you´ll see the error line:

# logrotate /etc/logrotate.conf -f
error: failed to open /var/log/mail.log-20081030.gz for mailing: No such file 
or directory 
 
Obviously file *gz doesnt exist because delaycompress is active and "yesterday" 
log isnt compressed.
 
- Bad solution: Comment delaycompress directive, but i dont like this.
 
- Temporary solution for me is to comment "mail" directive and run a tiny 
postrotate script like this:
 
/var/log/mail.log {
        dateext
#        mailfirst
#        mail [EMAIL PROTECTED]
        missingok
        daily
        rotate 365
        create
        compress
        delaycompress
        start 0
        postrotate
 
                T_FILE="${1}-$(date +%Y%m%d)"
                bzip2 -k $T_FILE
                uuencode ${T_FILE}.bz2 ${T_FILE}.bz2 |mail -s "Mail log subject 
here" [EMAIL PROTECTED]
                rm ${T_FILE}.bz2
 
        endscript
 
}

Its some different that the original function, because I have "yesterday" log 
decompressed in the system but compressed in backup email, and archive.log is 
adjunted, not printed in body message.

- For a real and origin function reproduction, it should be:

# Script

postrotate

        T_FILE="${1}-$(date +%Y%m%d)"
        echo $T_FILE |mail -s "Mail log subject here" [EMAIL PROTECTED] 

endscript

# /Script
                  
Thank you very much for your effor maintaining this package, and sorry for my 
english.

Regards,
 
Jesús Feliz Fernández.
 



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to