passing values into logrotate??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting passing values into logrotate??
# 1  
Old 07-13-2005
passing values into logrotate??

Wondering if this is possible?

OK, here is my question. I'm backing up a TON of different logs in different locations. I'm querying a database for the information. What I'd like to do, is pass that information into a logrotate script for the backup..

i.e. I'm trying to do the following:

logrotate -v /usr/local/bin/logrotate-config DIR1 HOST REFNUM (these last three would in theory be fed by a perl script)

Where logrotate-config is:

/logs/backups/$1/$2{
nomissingok
compress
nomail
notifempty
olddir /logs/archive/$2-archive
postrotate
/bin/kill -HUP `cat /var/run/syslog-ng.pid 2>/dev/null` 2> /dev/null || true
mv /logs/backups/$1/$2 /logs/archives/$1.$3.`date +%Y%m%d`.$2
endscript
}


Is something like this possible? It doesn't work so far...

Thanks!
# 2  
Old 06-09-2008
Kinda ugly, but...
  1. Call "myScript.pl" which writes the logrotate-config file
  2. Call logrotate (inside Perl script) using the newly created logrotate-config
  3. Repeat for all possibilities
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

Values passing out of isql session

hi .. i have a isql session which inside which i have two variables defined.. i wanna calculate % based on those variables. i knw i can easily do % calculation in csh if i could get the value of these variables passed outside the isql session . is tat possible ?? pls advice somthin like below... (1 Reply)
Discussion started by: Rahul619
1 Replies

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

4. Shell Programming and Scripting

Passing values in expect package

i am having specific number of input( as per o/p of another script) say 10 like d1,d2,d3....d10 i want to pass these o/p to expect script.But i don't know how to do that the the input to the expect script should be like this /expect_script.exp $d1 $d2......$dn as this "dn" depends in... (6 Replies)
Discussion started by: sagar_1986
6 Replies

5. Web Development

Passing values in PHP using POST

Lets say that I have a URL that consists of: myserver/something1.php My second URL is myserver/something2.php I have a variable called $var inside something1.php and once I submit the website the $var changes. Now when I do this I want to send this value using POST to something2.php and echo... (1 Reply)
Discussion started by: puttster
1 Replies

6. Web Development

Help with passing HTML values in to JavaScript

Not sure if this is the right place to ask this but here goes. I am creating a cheat sheet for co-workers. The concept is that you pick wire size and conduit size and the amount of wires that will fit is displayed. I haven't used alot of drop downs and can't quite figure out the way the get id... (3 Replies)
Discussion started by: zero3ree
3 Replies

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

8. Shell Programming and Scripting

passing values to function in Ksh

Hi, I'm trying to work on the script given below #!/bin/ksh -x pfile() { echo "$1" } touch smp19 echo "Hi" > smp19 result=$(pfile $smp19) echo $result As highlighted , when i pass $smp19 as parameter ,it does not display the output.However when i try giving "Hi" instead... (2 Replies)
Discussion started by: Sheema
2 Replies

9. UNIX for Advanced & Expert Users

Passing values from SQR to UNIX

UNIX script running a SQR program.... no problem passing values to SQR program... trying to pass values back to UNIX.... I'm currently creating a file from the SQR program and then using the Unix READ command to read the file and retrieve the value.... Is there an easier way to pass the... (2 Replies)
Discussion started by: seeuinoz
2 Replies

10. Shell Programming and Scripting

Passing values out awk.

found that passing (input) values to awk, all work well. For example: errpt | awk 'BEGIN { errore=0 } substr($2,1,4) /'ParamData'/ { .... } ' ParamData=`date +"%m%d"` Now I wish to obtain (output) a value. Using this method is it possible to re-write ParamData, for example? Thanks in... (3 Replies)
Discussion started by: gio123bg
3 Replies
Login or Register to Ask a Question