Gzip list of logfiles
Hello,
I have a list of logfiles, whose names start with a common name and appended by .1, .2 etc(created by log4j). Now I want to retrieve these files from a shell script and run gzip for these files. Here is the code that I wrote, but it is not working. PACKAGERLOGDIR is location of logfile PACKAGER_LOGFILE is a file containing the String that these logfile names start with. My Program is find $PACKAGERLOGDIR -name ` cat $PACKAGER_LOGFILE` > $filelist for file in `cat $filelist`; do gzip $file done. This is not working. Could any help me find out where I am going wrong. Thanks, Lakshmi |
Take it one command at a time...
first, does your find statement produce the desired result? (Re-directing to a filename starting with "$" does not look right to me.) |
Wouldn't it be better just to use the logrotate tool to handle that automatically?
|
All times are GMT -5. The time now is 06:59 PM. |