File is missing after logrotate!!

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat File is missing after logrotate!!
# 1  
Old 03-01-2013
File is missing after logrotate!!

I am having a requirement to rotate the my application logs dailay as it is keep on writiing to single file and below is the logrotate function which I am using,

Code:
cat /apps/bmc/bmtm/QPasa_logrotate.conf
/apps/bmc/bmtm/all_events.log /apps/bmc/bmtm/history_association.log {
    missingok
    notifempty
    daily
    rotate 15
    create 0755 mqm mqm
}

when I execute the about function with logrotate with debug mode it is clearly showing that log files are rotated however when I do list the files they are not availble and the orignal file has the same content.

Code:
/usr/sbin/logrotate -dv /apps/bmc/bmtm/QPasa_logrotate.conf
reading config file /apps/bmc/bmtm/QPasa_logrotate.conf
reading config info for /apps/bmc/bmtm/all_events.log /apps/bmc/bmtm/history_association.log
Handling 1 logs
rotating pattern: /apps/bmc/bmtm/all_events.log /apps/bmc/bmtm/history_association.log  after 1 days (15 rotations)
empty log files are not rotated, old logs are removed
considering log /apps/bmc/bmtm/all_events.log
  log needs rotating
considering log /apps/bmc/bmtm/history_association.log
  log needs rotating
rotating log /apps/bmc/bmtm/all_events.log, log->rotateCount is 15
renaming /apps/bmc/bmtm/all_events.log.15 to /apps/bmc/bmtm/all_events.log.16 (rotatecount 15, logstart 1, i 15),
renaming /apps/bmc/bmtm/all_events.log.14 to /apps/bmc/bmtm/all_events.log.15 (rotatecount 15, logstart 1, i 14),
renaming /apps/bmc/bmtm/all_events.log.13 to /apps/bmc/bmtm/all_events.log.14 (rotatecount 15, logstart 1, i 13),
renaming /apps/bmc/bmtm/all_events.log.12 to /apps/bmc/bmtm/all_events.log.13 (rotatecount 15, logstart 1, i 12),
renaming /apps/bmc/bmtm/all_events.log.11 to /apps/bmc/bmtm/all_events.log.12 (rotatecount 15, logstart 1, i 11),
renaming /apps/bmc/bmtm/all_events.log.10 to /apps/bmc/bmtm/all_events.log.11 (rotatecount 15, logstart 1, i 10),
renaming /apps/bmc/bmtm/all_events.log.9 to /apps/bmc/bmtm/all_events.log.10 (rotatecount 15, logstart 1, i 9),
renaming /apps/bmc/bmtm/all_events.log.8 to /apps/bmc/bmtm/all_events.log.9 (rotatecount 15, logstart 1, i 8),
renaming /apps/bmc/bmtm/all_events.log.7 to /apps/bmc/bmtm/all_events.log.8 (rotatecount 15, logstart 1, i 7),
renaming /apps/bmc/bmtm/all_events.log.6 to /apps/bmc/bmtm/all_events.log.7 (rotatecount 15, logstart 1, i 6),
renaming /apps/bmc/bmtm/all_events.log.5 to /apps/bmc/bmtm/all_events.log.6 (rotatecount 15, logstart 1, i 5),
renaming /apps/bmc/bmtm/all_events.log.4 to /apps/bmc/bmtm/all_events.log.5 (rotatecount 15, logstart 1, i 4),
renaming /apps/bmc/bmtm/all_events.log.3 to /apps/bmc/bmtm/all_events.log.4 (rotatecount 15, logstart 1, i 3),
renaming /apps/bmc/bmtm/all_events.log.2 to /apps/bmc/bmtm/all_events.log.3 (rotatecount 15, logstart 1, i 2),
renaming /apps/bmc/bmtm/all_events.log.1 to /apps/bmc/bmtm/all_events.log.2 (rotatecount 15, logstart 1, i 1),
renaming /apps/bmc/bmtm/all_events.log.0 to /apps/bmc/bmtm/all_events.log.1 (rotatecount 15, logstart 1, i 0),
renaming /apps/bmc/bmtm/all_events.log to /apps/bmc/bmtm/all_events.log.1
creating new log mode = 0755 uid = 135106 gid = 59
removing old log /apps/bmc/bmtm/all_events.log.16
rotating log /apps/bmc/bmtm/history_association.log, log->rotateCount is 15
renaming /apps/bmc/bmtm/history_association.log.15 to /apps/bmc/bmtm/history_association.log.16 (rotatecount 15, logstart 1, i 15),
renaming /apps/bmc/bmtm/history_association.log.14 to /apps/bmc/bmtm/history_association.log.15 (rotatecount 15, logstart 1, i 14),
renaming /apps/bmc/bmtm/history_association.log.13 to /apps/bmc/bmtm/history_association.log.14 (rotatecount 15, logstart 1, i 13),
renaming /apps/bmc/bmtm/history_association.log.12 to /apps/bmc/bmtm/history_association.log.13 (rotatecount 15, logstart 1, i 12),
renaming /apps/bmc/bmtm/history_association.log.11 to /apps/bmc/bmtm/history_association.log.12 (rotatecount 15, logstart 1, i 11),
renaming /apps/bmc/bmtm/history_association.log.10 to /apps/bmc/bmtm/history_association.log.11 (rotatecount 15, logstart 1, i 10),
renaming /apps/bmc/bmtm/history_association.log.9 to /apps/bmc/bmtm/history_association.log.10 (rotatecount 15, logstart 1, i 9),
renaming /apps/bmc/bmtm/history_association.log.8 to /apps/bmc/bmtm/history_association.log.9 (rotatecount 15, logstart 1, i 8),
renaming /apps/bmc/bmtm/history_association.log.7 to /apps/bmc/bmtm/history_association.log.8 (rotatecount 15, logstart 1, i 7),
renaming /apps/bmc/bmtm/history_association.log.6 to /apps/bmc/bmtm/history_association.log.7 (rotatecount 15, logstart 1, i 6),
renaming /apps/bmc/bmtm/history_association.log.5 to /apps/bmc/bmtm/history_association.log.6 (rotatecount 15, logstart 1, i 5),
renaming /apps/bmc/bmtm/history_association.log.4 to /apps/bmc/bmtm/history_association.log.5 (rotatecount 15, logstart 1, i 4),
renaming /apps/bmc/bmtm/history_association.log.3 to /apps/bmc/bmtm/history_association.log.4 (rotatecount 15, logstart 1, i 3),
renaming /apps/bmc/bmtm/history_association.log.2 to /apps/bmc/bmtm/history_association.log.3 (rotatecount 15, logstart 1, i 2),
renaming /apps/bmc/bmtm/history_association.log.1 to /apps/bmc/bmtm/history_association.log.2 (rotatecount 15, logstart 1, i 1),
renaming /apps/bmc/bmtm/history_association.log.0 to /apps/bmc/bmtm/history_association.log.1 (rotatecount 15, logstart 1, i 0),
renaming /apps/bmc/bmtm/history_association.log to /apps/bmc/bmtm/history_association.log.1
creating new log mode = 0755 uid = 135106 gid = 59
removing old log /apps/bmc/bmtm/history_association.log.16

Here is the log file listing and there are no log file found after the rotation.

Code:
 ls -l all*
-rwxrw-rw- 1 mqm mqm 13662 Feb 28 05:55 all_events.log
 ls -l his*
-rwxr-xr-x 1 mqm mqm 2401369 Mar  1 00:00 history_association.log

kinldy assist me to fix this issue.
# 2  
Old 03-01-2013
Read the logrotate manpage. What you are seeing is the expected behavior using the debug option.
Quote:
-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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Logrotate 0 byte file

Hello, For various reasons I decided to rebuild my log server on a new microSD. To simplify matters I restored a backed up copy of the appropriate config files and uploaded them to the new log server once syslog-ng was setup. The issue I am running into now is when logrotate compresses the log... (3 Replies)
Discussion started by: MyUserName7000
3 Replies

2. UNIX for Beginners Questions & Answers

Logrotate exclude log file

Hi all ! I've an issue to exclude a log file from logrotate, I tried this below: /var/log/apache2/*.log { olddir /var/log/apache2/old missingok rotate 50 compress copytruncate notifempty create 644 root root } I tried also:... (0 Replies)
Discussion started by: Arnaudh78
0 Replies

3. Solaris

How to logrotate a file after X days with logadm?

Hi Guys - We have the /var/adm/pacct file currently configured to log rotate using logadm - here is the entry in logadm.conf: /var/adm/pacct -C 0 -N -P 'Wed Oct 23 08:00:00 2013' -a '/usr/lib/acct/accton pacct' -g adm -m 664 -o adm -p never Just want to ask if it would like possible to... (1 Reply)
Discussion started by: akaterasu
1 Replies

4. AIX

Logrotate - /etc/logrotate.conf does't exist

Hi Admins. I have installed logrotate rpm on Aix 6.1. After the installation of rpm, I don't find /etc/logrotate.conf file and /etc/logrotate.d dir . The config file is located in /opt/freeware/etc/logrotate.conf. When I ran logrotate -v /opt/freeware/etc/logrotate.conf I get below... (2 Replies)
Discussion started by: snchaudhari2
2 Replies

5. Red Hat

Logrotate to delete file which has date stamp

Hello, can someone please suggest how to create an logrotate for this scenario. Need to delete all log file which are created more than 30 days ago, and all the log file have date stamp on it. I dont want to create a cron job for this task. here is the example -rw-r--r-- 1 tomcat tomcat ... (2 Replies)
Discussion started by: bobby320
2 Replies

6. Shell Programming and Scripting

Logrotate - I am not able to rotate files using logrotate

I have written script which is working in Home directory perfectly and also compressing log files and rotating correctly. But, when i try to run script for /var/log/ i am able to get compressed log files but not able to get rotation of compressed log files. Please suggest. I am using below command... (5 Replies)
Discussion started by: VSom007
5 Replies

7. UNIX for Dummies Questions & Answers

Explain this logrotate file

Very silly question .. I deleted it .. Please delete this thread too . (0 Replies)
Discussion started by: stunn3r
0 Replies

8. Shell Programming and Scripting

How to give the zip file name in logrotate?

Hi, How to give file name for the zip file while compressing in logrotate... Should we need to give it in the logrotate.conf file or in the spec file...? (2 Replies)
Discussion started by: Dedeepthi
2 Replies

9. Shell Programming and Scripting

logrotate irrespective of the size of a file/directory

hi, How to logrotate irrespective of the size of a file/directory...? Please help me in this regard... (4 Replies)
Discussion started by: Dedeepthi
4 Replies

10. UNIX for Advanced & Expert Users

logrotate with /etc/logrotate.conf file

Hi there, I want to rotate the logfiles which are located in /var/log/jboss/tomcat* so I have created a file named as 'tomat' in /etc/logrotate.d/tomcat with the following content. # cat /etc/logrotate.d/tomcat /var/log/jboss/tomcat_access_log*.log { daily nocreate ... (2 Replies)
Discussion started by: skmdu
2 Replies
Login or Register to Ask a Question