A small help needed in Logrotate


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting A small help needed in Logrotate
# 1  
Old 10-06-2011
A small help needed in Logrotate

Hi,

I wanted to know can a custom script can be made available to run in

Code:
postroate
endscript

something like

Code:
postrotate
./scriptpath/sh-script.sh
endscript

Is this the correct syntax, or it will require any modification?

Thanks in Advance.
Neeryan

Last edited by pludi; 10-06-2011 at 03:48 PM..
# 2  
Old 10-06-2011
Best to fully qualify your path as current directory may vary:

use:
Code:
postrotate
/usr/local/bin/apache2/bin/scriptpath/sh-script.sh
endscript

Instead of:
Code:
postrotate
./scriptpath/sh-script.sh
endscript

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Logrotate configuration

Hi all, i would like to have a configuration on log rotate that will gzip my log files with date pattern %Y-%m-%d move these files to an olddir, but i want to avoid that the logrotate removes my files from old dir newer than 180 days i applyied this config #logrotate config to compress files... (3 Replies)
Discussion started by: charli1
3 Replies

2. AIX

Logrotate.conf

Hey Admins, I have installed logrotate on AIX server. I want to configure it for 1. /var/log/messages – keep 90 days, i.e., weekly rotate 13 2. Syslog – keep 90 days i.e., weekly rotate 13 3. Wtmp – keep 90 days i.e., weekly rotate 13 4. Sulog – keep 90 days i.e., weekly rotate 13 What... (1 Reply)
Discussion started by: snchaudhari2
1 Replies

3. 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

4. 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

5. Shell Programming and Scripting

Help needed on Perl Script to Handle Log files that are rotated using logrotate

Hello all, I am working on a perl script which will read weblogic logfile and send the error messages to Zenoss Monitoring tool. At present the script works and it can able to send the error messages to Zenoss. The problem comes when the logrotate has been applied to the weblogic log file. At... (3 Replies)
Discussion started by: kar_333
3 Replies

6. UNIX for Dummies Questions & Answers

help needed with a small shell script!

I have a scenario where i need to look for files of these kind filename.log.0 filename.log.1 if the files are present, then no action is to be taken, if not found, then it shud create/touch files with the same name. so can anyone help constructing the script for me..appreciate ur help. ... (5 Replies)
Discussion started by: win4luv
5 Replies

7. Linux

LogRotate

Hi I am trying to rotate specific log by using logrotate function in unix I have made following entry in the /etc/logrotate.conf file /var/log/testlog/debug_log { daily rotate 7 create compress } But only issue is that my other logs like /var/log/messages,... (2 Replies)
Discussion started by: SiddhV
2 Replies

8. 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

9. UNIX for Advanced & Expert Users

logrotate question

I am getting this system message: /etc/cron.daily/logrotate: error: rsync:7 unknown option 'endscript' -- ignoring line I don't find anything related to rsync in the logrotate.conf file, so I am unsure as to how to resolve this and stop this message. Thanks. (1 Reply)
Discussion started by: manouche
1 Replies

10. UNIX for Advanced & Expert Users

logrotate.conf

I changed the logrotate.conf file to make a new log file to be automatically rotated daily. But after a night, I have not seen the rotated file. When does this rotation happen? I mean what is the exact time? In addition, do I have to restart what deamon to make the change take effect? (10 Replies)
Discussion started by: fredao
10 Replies
Login or Register to Ask a Question