FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 09-26-2008, 07:49 AM
"Kaushal Shriyan"
 
Default logrotate

Hi,

I am using logrotate utility on gentoo 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


reading config file /usr/local/bin/scripts/logrotate-tomcat5-catalina.conf
reading config info for /var/log/tomcat5/catalina.out
compress_prog is now /bin/gzip
*
Handling 1 logs
*
rotating pattern: /var/log/tomcat5/catalina.out after 1 days (7 rotations)


empty log files are not rotated, old logs are removed
considering log /var/log/tomcat5/catalina.out
log needs rotating
rotating log /var/log/tomcat5/catalina.out, log->rotateCount is 7
renaming /var/log/tomcat5/catalina.out.7.gz to /var/log/tomcat5/catalina.out.8.gz (rotatecount 7, logstart 1, i 7),


renaming /var/log/tomcat5/catalina.out.6.gz to /var/log/tomcat5/catalina.out.7.gz (rotatecount 7, logstart 1, i 6),
renaming /var/log/tomcat5/catalina.out.5.gz to /var/log/tomcat5/catalina.out.6.gz (rotatecount 7, logstart 1, i 5),


renaming /var/log/tomcat5/catalina.out.4.gz to /var/log/tomcat5/catalina.out.5.gz (rotatecount 7, logstart 1, i 4),
renaming /var/log/tomcat5/catalina.out.3.gz to /var/log/tomcat5/catalina.out.4.gz (rotatecount 7, logstart 1, i 3),


renaming /var/log/tomcat5/catalina.out.2.gz to /var/log/tomcat5/catalina.out.3.gz (rotatecount 7, logstart 1, i 2),
renaming /var/log/tomcat5/catalina.out.1.gz to /var/log/tomcat5/catalina.out.2.gz (rotatecount 7, logstart 1, i 1),


renaming /var/log/tomcat5/catalina.out.0.gz to /var/log/tomcat5/catalina.out.1.gz (rotatecount 7, logstart 1, i 0),
copying /var/log/tomcat5/catalina.out to /var/log/tomcat5/catalina.out.1
truncating /var/log/tomcat5/catalina.out


error: unable to open /var/log/tomcat5/catalina.out.1 for compression
#
#cat /usr/local/bin/scripts/logrotate-tomcat5-catalina.conf
/var/log/tomcat5/catalina.out {
daily

missingok
copytruncate
rotate 7
compress
compresscmd /bin/gzip
notifempty
}
#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 112G 27G 85G 24% /


udev 7.9G 156K 7.9G 1% /dev
shm 7.9G 0 7.9G 0% /dev/shm
/dev/sda1 479M 44M 411M 10% /boot
# ls -l /var/log/tomcat5/catalina.out*
-rw-r--r-- 1 tomcat tomcat 325519875 Sep 26 00:24 /var/log/tomcat5/catalina.out
#

Any ideas as what is going wrong

Thanks and Regards

Kaushal
 
Old 09-26-2008, 07:58 AM
"Kaushal Shriyan"
 
Default logrotate

Hi,

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



reading config file /usr/local/bin/scripts/logrotate-tomcat5-catalina.conf
reading config info for /var/log/tomcat5/catalina.out
compress_prog is now /bin/gzip
*
Handling 1 logs
*
rotating pattern: /var/log/tomcat5/catalina.out after 1 days (7 rotations)



empty log files are not rotated, old logs are removed
considering log /var/log/tomcat5/catalina.out
log needs rotating
rotating log /var/log/tomcat5/catalina.out, log->rotateCount is 7
renaming /var/log/tomcat5/catalina.out.7.gz to /var/log/tomcat5/catalina.out.8.gz (rotatecount 7, logstart 1, i 7),



renaming /var/log/tomcat5/catalina.out.6.gz to /var/log/tomcat5/catalina.out.7.gz (rotatecount 7, logstart 1, i 6),
renaming /var/log/tomcat5/catalina.out.5.gz to /var/log/tomcat5/catalina.out.6.gz (rotatecount 7, logstart 1, i 5),



renaming /var/log/tomcat5/catalina.out.4.gz to /var/log/tomcat5/catalina.out.5.gz (rotatecount 7, logstart 1, i 4),
renaming /var/log/tomcat5/catalina.out.3.gz to /var/log/tomcat5/catalina.out.4.gz (rotatecount 7, logstart 1, i 3),



renaming /var/log/tomcat5/catalina.out.2.gz to /var/log/tomcat5/catalina.out.3.gz (rotatecount 7, logstart 1, i 2),
renaming /var/log/tomcat5/catalina.out.1.gz to /var/log/tomcat5/catalina.out.2.gz (rotatecount 7, logstart 1, i 1),



renaming /var/log/tomcat5/catalina.out.0.gz to /var/log/tomcat5/catalina.out.1.gz (rotatecount 7, logstart 1, i 0),
copying /var/log/tomcat5/catalina.out to /var/log/tomcat5/catalina.out.1
truncating /var/log/tomcat5/catalina.out



error: unable to open /var/log/tomcat5/catalina.out.1 for compression
#
#cat /usr/local/bin/scripts/logrotate-tomcat5-catalina.conf
/var/log/tomcat5/catalina.out {
daily

missingok


copytruncate
rotate 7
compress
compresscmd /bin/gzip
notifempty
}
#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 112G 27G 85G 24% /



udev 7.9G 156K 7.9G 1% /dev
shm 7.9G 0 7.9G 0% /dev/shm
/dev/sda1 479M 44M 411M 10% /boot
# ls -l /var/log/tomcat5/catalina.out*
-rw-r--r-- 1 tomcat tomcat 325519875 Sep 26 00:24 /var/log/tomcat5/catalina.out


#

Any ideas as what is going wrong

Thanks and Regards

Kaushal

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-26-2008, 09:03 AM
Ulf Rompe
 
Default logrotate

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@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-26-2008, 01:19 PM
"Kaushal Shriyan"
 
Default logrotate

On Fri, Sep 26, 2008 at 2:33 PM, Ulf Rompe <Ulf.Rompe@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@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@example.com,ravik@example.com,umang@exampl e.com

else
echo "Problems." | /usr/bin/nail -n -s "[CRON] host0086 compress tomcat-sms catalina.log - problems" kaushal@example.com,ravik@example.com,umang@exampl e.com

fi

Please let me know if I am doing wrong

Thanks and Regards

Kaushal



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 02:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org