LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2009, 03:21 AM   #1
Kabelom
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Linux shell scripting on cluster using sun grid Engine


Good day ..i am a student and i am been trying to experiment by writing a shell scripting using SGE commands & awk &sed commands without any success .the script has to output system statistics eg the types of queues (Jobs Available,Jobs Waiting ,Jobs Errors) and the quota ..it has to display when the user log on the cluster .it has to be a summary ..the main aim the user doesnt have to use qstat command when he is on the cluster ,the script has to simplify the users work

even if the script doesnt use other commands as long i can try to get ideas or script that can give me the output i want ..please help

Last edited by Kabelom; 07-27-2009 at 03:26 AM.
 
Old 07-27-2009, 04:46 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Please don't make multiple posts. Choose one forum that you think best fits your topic. If you've accidentally posted to the wrong forum, use the "report" button and ask a moderator to move it for you.

Second, you need to provide some details. At the very least post the relevant parts of the script you're working on. Since this appears to be a homework assignment, you're not going to get any spoon-fed answers, but we can help guide you to a working solution.
 
Old 07-27-2009, 04:59 AM   #3
Kabelom
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
My script that i wrote

Thanks for the guidance ,its my first time posting a question.Secondly its not a school assignment,its sumthing (little Project) i am trying to work on to help me learn Shell scripting ,Linux and Sun Grid Engine



#! /bin/sh
#$ -S /bin/bash


echo "=================================================================================================== ==========================="
echo "= WELCOME TO C4 ="
echo "=================================================================================================== ==========================="
echo "= SYSTEMS STATISTICS SUMMARY ="
echo "=================================================================================================== ==========================="
qacct -q
qstat
qacct -o

qacct -A -b
qacct -slots
qstat -g c -l arch=lx24-amd64 -q all.q | awk 'NR > 2 {sum = sum + $4} END {print sum}'

qstat -r
qstat -t
qstat -u '*'
qstat -explain E
qstat -u sjf4

qstat -f
qstat -u kmahloane
qstat -j

qstat -g c


quota
quota -u kmahloane
quota -g c -l arch=lx24-amd64 -q all.q | awk 'NR > 2 {sum = sum + $4} END {print sum}'
quota -u '*' -P '*' -q '*'

{
qconf --sconf
qconf -srgsl
qconf -args
qconf -srgs
}
 
Old 07-27-2009, 09:14 AM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Please put large blocks of code inside [code][/code] tags, so that the formatting doesn't get lost and it doesn't break the layout of the page.

Now I have no experience with qstat (or any of the others you're calling) or what the output looks like. I'd have to see some example output in order to fully understand what you're trying to extract.

But from a first glance, it looks like you're calling these various "q*" commands over and over again in order to get different values. I think, if it's possible, that it would be much more efficient to get all of your output at once and store it in a variable or two (or perhaps an array). Try to combine as many operations as possible into a single command. Then you can parse those variables for the information you want and store the values in variables too. Then you can create a final output form that will print those variables in a readable fashion. You might want to create separate functions for each of these processes.
 
  


Reply

Tags
aim, as, awk, been, can, cluster, command, commands, day, display, errors, experiment, get, has, help, ideas, if, jobs, log, long, main, output, please, quota, script, scripting, sed, shell, student, success, types, user, users, using, writing



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Sun Grid Engine on linux me_spearhead Linux - General 5 03-12-2010 07:11 AM
Does anybody knows SUN GRID ENGINE?? meng_en Linux - General 4 02-24-2010 11:03 PM
Urgent: Need Sun Grid 6.1u5 for Unix(Sparc)/Linux(Amd-64) rhel5 Linux - Software 1 05-16-2009 03:13 AM
SGE (Sun Grid Engine) advice please johnsfine Linux - Networking 0 05-06-2009 02:55 PM
Installation Of Sun Grid Engine parani86 Linux - Software 7 08-06-2008 07:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration