ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Challenge Forum » Challenge Question - 06 / 2008

This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies. Goto page Previous  1, 2, 3
 Challenge Question - 06 / 2008 « View previous topic :: View next topic » 
Author Message
exerk
PostPosted: Sat Jun 28, 2008 2:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
Challenger
PostPosted: Mon Jun 30, 2008 1:18 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Mon Jun 30, 2008 7:52 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

mvic?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
harwinderr
PostPosted: Mon Jun 30, 2008 8:07 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
harwinderr
PostPosted: Mon Jun 30, 2008 8:17 am    Post subject: dgolding ?? Reply with quote

Voyager

Joined: 29 Jan 2002
Posts: 90

dgolding ??
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
dgolding
PostPosted: Mon Jun 30, 2008 10:21 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Mehrdad
PostPosted: Tue Jul 01, 2008 1:29 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies. Goto page Previous  1, 2, 3 Page 3 of 3

MQSeries.net Forum Index » Challenge Forum » Challenge Question - 06 / 2008
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.