logrotate
Kaushal Shriyan
kaushalshriyan at gmail.com
Fri Sep 26 13:19:16 UTC 2008
On Fri, Sep 26, 2008 at 2:33 PM, Ulf Rompe <Ulf.Rompe at icem.com> wrote:
> On Fr, 2008-09-26 at 13:28 +0530, Kaushal Shriyan wrote:
> > I am using logrotate utility to compress catalina.out file. when i run
> > it using debug mode, I get
> > #/usr/sbin/logrotate -dv
> /usr/local/bin/scripts/logrotate-tomcat5-catalina.conf
> [...]
> > copying /var/log/tomcat5/catalina.out to /var/log/tomcat5/catalina.out.1
> [...]
> > error: unable to open /var/log/tomcat5/catalina.out.1 for compression
> [...]
> > Any ideas as what is going wrong
>
> Well, you are running in debug mode. From the logrotate man page:
>
> -d Turns on debug mode and implies -v. In debug mode, no
> changes
> will be made to the logs or to the logrotate state file.
>
> That means the error message is completely OK. Logrotate will start to
> do it's work once you remove the "-d" option. If you want to monitor
> it's progress, just stay with "-v".
>
> [x] ulf
>
> --
> Doing a job RIGHT the first time gets the job done.
> Doing the job WRONG fourteen times gives you job security.
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
Hi ulf
In the script I should have it as
/usr/sbin/logrotate -v
/usr/local/bin/scripts/logrotate-tomcat-sms-catalina.conf
instead of
/usr/sbin/logrotate
/usr/local/bin/scripts/logrotate-tomcat-sms-catalina.conf
My Bash script is as below
#cat /usr/local/bin/scripts/call-logrotate-tomcat-sms-catalina
#!/bin/bash
/usr/sbin/logrotate
/usr/local/bin/scripts/logrotate-tomcat-sms-catalina.conf > /tmp/log 2>&1
if [[ $? -eq 0 ]] ;then
echo "Successful." | /usr/bin/nail -n -s "[CRON] host0086 compress
tomcat-sms catalina.log - success" kaushal at example.com,ravik at example.com,
umang at example.com
else
echo "Problems." | /usr/bin/nail -n -s "[CRON] host0086 compress tomcat-sms
catalina.log - problems" kaushal at example.com,ravik at example.com,
umang at example.com
fi
Please let me know if I am doing wrong
Thanks and Regards
Kaushal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080926/ebd87d54/attachment.html>
More information about the ubuntu-users
mailing list