Logrotate with catalina.out "daily compressed file is overwriting the logs"


 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Logrotate with catalina.out "daily compressed file is overwriting the logs"
Prev   Next
# 1  
Old 01-08-2016
Logrotate with catalina.out "daily compressed file is overwriting the logs"

Hi Everyone,

We are trying to do a logrotate for "catalina.out" daily, So have used the "copytruncate" option in the logrotate configuration but ended up seeing there was a 0kb file touched with "catalina.out" and the other file with the current date(compressed) file created and seems the log is writing to it as below.

The expected behavior is the log should be written to "catalina.out" and there should not be a today dated compressed file that is getting written. Can someone please suggest..

Config:
Code:
/var/log/tomcat/catalina.out {
    copytruncate
    daily
    rotate 7
    compress
    missingok
}

Code:
Log file:
-rw-rw-r-- 1 tomcat www 139K Dec 21 03:39 catalina.out-20151220.gz
-rw-rw-r-- 1 tomcat www  20K Jan  5 06:48 catalina.out-20160105.gz
-rw-rw-r-- 1 tomcat www 3.9K Jan  6 03:11 catalina.out-20160106.gz
-rw-rw-r-- 1 tomcat www  11K Jan  7 03:43 catalina.out-20160107.gz
-rw-rw-r-- 1 tomcat www 2.9K Jan  8 03:41 catalina.out-20160108.gz   ----- it's getting updated here & it should have not been compressed today..
-rw-rw-r-- 1 tomcat www    0 Jan  8 03:41 catalina.out  ----- Expecting this file to be updated
 logrotate.d]$ date
Fri Jan  8 06:41:34 CST 2016

Moderator's Comments:
Mod Comment Please use code tags.

-
Thiyags.

Last edited by jim mcnamara; 01-08-2016 at 09:38 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Beginners Questions & Answers

"unzip" compressed security camera videos

Good afternoon, I started apologizing for not creating a specific topic with my subject, I could not find the option to create a topic, friends, if someone can help me thank you very much, I have a problem, I have a DVR with a HISILICON HI chip 3520, it compresses and encrypts the videos recorded... (2 Replies)
Discussion started by: cristopher0258
2 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. Shell Programming and Scripting

Perl failure with "main::$fn" used only once:" in error logs

Hi all, Can anyone guess why this is happening? I am new to Perl, so please help me to fix this error: - I have a static html file which calls the cgi-perl script. HTML Code: <html> <head> <title> Hey Dude! </title> </head> <body> <form method="POST"... (3 Replies)
Discussion started by: bashily
3 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

catalina.sh : need combination from "start" and "run"

heya, can someone help me with following problem. i am not sure how far you know the catalina.sh script from tomcat. when i start my tomcat with "catalina.sh run" then the startup-process-output will be printed out on the console, but the tomcat process is started in current shell/session, so... (1 Reply)
Discussion started by: Filly
1 Replies

7. UNIX for Dummies Questions & Answers

Does "gzip" have a no prompt option on it for overwriting if file exists?

So I dont enounter things like: gzip: /sometimename.gz already exists; do you wish to overwrite (y or n)? Want to add it into a script and if there is a file aready there to just overwrite it, otherwise the script will hang unless there is manual intervention. (1 Reply)
Discussion started by: LordJezo
1 Replies

8. UNIX for Dummies Questions & Answers

"looping" compressed file

I've got a problem with a .z compressed file: when I decompress it, I get a .gz file, and when I decompress this one, I get the previous .z file again! Does anyone know how do I break off this loop? (1 Reply)
Discussion started by: exile
1 Replies
Login or Register to Ask a Question