The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
passing variable values to awk command jerardfjay Shell Programming and Scripting 1 05-22-2008 12:48 PM
passing values from sql to shell script sachin.gangadha Shell Programming and Scripting 3 04-22-2008 08:11 PM
Passing Values from a shell script dhananjaysk Shell Programming and Scripting 6 04-06-2006 06:33 AM
Passing values from SQR to UNIX seeuinoz UNIX for Advanced & Expert Users 2 08-24-2005 12:54 PM
Passing values out awk. gio123bg Shell Programming and Scripting 3 12-09-2003 10:32 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-13-2005
Registered User
 

Join Date: Jul 2005
Posts: 1
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!
Reply With Quote
Forum Sponsor
  #2  
Old 06-09-2008
Registered User
 

Join Date: Jul 2007
Location: Cloud 9
Posts: 70
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0