Author |
Message
|
exerk |
Posted: Sat Jun 28, 2008 2:34 pm Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Are you Vitor? _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
Challenger |
Posted: Mon Jun 30, 2008 1:18 am Post subject: |
|
|
 Centurion
Joined: 31 Mar 2008 Posts: 115
|
I am not that illustrious grand master but thank you for the honour. here's yet another clue, I'm one of the first fifty people to join, and my avatar is a rather old school photograph of me - taken the same month and year as the first Apollo moon landing |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jun 30, 2008 7:52 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mvic? _________________ MQ & Broker admin |
|
Back to top |
|
 |
harwinderr |
Posted: Mon Jun 30, 2008 8:07 am Post subject: |
|
|
 Voyager
Joined: 29 Jan 2002 Posts: 90
|
Had to work a little bit on the script to make it more user friendly. Pls feel free to change/modify it to make it work on your environments.
Code: |
$ more mqlog_cleanup.sh
usage()
{
print "\nUSAGE:\t $0 <qmgr_name> <new_directory_to_move_logs>"
exit 2
}
if [[ $# -ne 2 ]] ; then
usage
fi
qmgr=$1
newdir=$2
tmpfile=/tmp/$qmgr.logs
rm -f $tmpfile
wd=`pwd`
i=0
if [[ ! -d ${newdir} ]] ; then
mkdir -p $newdir
fi
cd /var/mqm/log/$qmgr/active
util=`df -k . | grep -v Filesystem | awk '{print $5}' | cut -d% -f1`
echo "Log file system for $qmgr is at $util %."
echo "\nMoving log files to $newdir ..."
ls -ltr | awk '{print $9}' >> $tmpfile
for file in `cat $tmpfile`
do
# Specify how much file system you would like to free.
if [[ $util -lt 65 ]] ; then
break
else
mv $file $newdir
ln -s $newdir/$file $file
util=`df -k . | grep -v Filesystem | awk '{print $5}' | cut -d% -f1`
i=`expr $i + 1`
fi
done
cd $wd
echo "\nMoved $i log files, util now is $util %. \n"
|
Cheers,
harwinderr |
|
Back to top |
|
 |
harwinderr |
Posted: Mon Jun 30, 2008 8:17 am Post subject: dgolding ?? |
|
|
 Voyager
Joined: 29 Jan 2002 Posts: 90
|
|
Back to top |
|
 |
dgolding |
Posted: Mon Jun 30, 2008 10:21 pm Post subject: |
|
|
 Yatiri
Joined: 16 May 2001 Posts: 668 Location: Switzerland
|
(Whips off obviously fake moustache) - "It is I, leClerc"
You got me there Harwinderr - and thanks for the script, and for everyone else who contributed |
|
Back to top |
|
 |
Mehrdad |
Posted: Tue Jul 01, 2008 1:29 am Post subject: |
|
|
Master
Joined: 27 Feb 2004 Posts: 219 Location: Europe
|
Don;
Many thanks for a well run June Challenge. It is much appreciated sir.
Regards;
Mehrdad |
|
Back to top |
|
 |
|