Need to keep your Linux based IDM log files for troubleshooting?
This script zips your log files up, keeping a zip file for each day.
if [ -e $1 ] ; then
# echo $strFile
# echo $strTime
mv $1 $strTime$1
zip $strFile -q -9 -o -m $strTime$1
echo "file not found"
Simply call the script passing the name of the log file you wish to archive and the path to your log files as command line parameters.
You can run this in your crontab, calling it every minute (or whatever period suites you) When the log file rolls over the _1.log file will be renamed with a time stamp and added to todays zip file. If the log file has not yet rolled the script just exits.
log_archiver.sh Driver1_1.log /IDMLOGS/
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.