Sponsored Content
Full Discussion: HELP for my script
Special Forums UNIX Desktop Questions & Answers HELP for my script Post 302908864 by SriniShoo on Friday 11th of July 2014 02:29:34 AM
Old 07-11-2014
Code:
#!/bin/bash
clear
add_user() {
## write your statements here
echo "Created user"
}
PS3="Enter your choice> "
select i in "Current Logins" "Last Logins" "Generate List of Users" "Create User Accounts" "Exit"
do

case $i in
"Current Logins") who;;
"Last Logins") lastlog;;
"Generate List of Users") awk -F':' '{ print $1}' /etc/passwd;;
"Create User Accounts") add_user;;
Exit) exit;;
*) echo "Invalid choice";;
esac 
done

This User Gave Thanks to SriniShoo For This Post:
 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

create a shell script that calls another script and and an awk script

Hi guys I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies

2. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

3. UNIX for Dummies Questions & Answers

Calling a script from master script to get value from called script

I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below. #masterscript.sh ./callingscript.sh echo $fileExist #callingscript.sh echo "The script is called"... (2 Replies)
Discussion started by: Raj Roy
2 Replies

4. Shell Programming and Scripting

Shell script works fine as a standalone script but not as part of a bigger script

Hello all, I am facing a weird issue while executing a code below - #!/bin/bash cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset sh UKBA_publish.sh UKBA 28082015 3 if then echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies

5. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies
SREPORT(1)							 Slurm components							SREPORT(1)

NAME
sreport - Generate reports from the slurm accounting data. SYNOPSIS
sreport [OPTIONS...] [COMMAND...] DESCRIPTION
sreport is used to generate reports of job usage and cluster utilization for SLURM jobs saved to the SLURM Database, slurmdbd. OPTIONS
-a, --all_clusters Use all clusters instead of only the cluster from where the command was run. -h, --help Print a help message describing the usage of sreport. -n, --noheader Don't display header when listing results. -p, --parsable Output will be '|' delimited with a '|' at the end. -P, --parsable2 Output will be '|' delimited without a '|' at the end. -Q, --quiet Print no warning or informational messages, only error messages. -t <format> Specify the output time format. Time format options are case insensitive and may be abbreviated. The default format is Minutes. Supported time format options are listed in the time command section below. -v, --verbose Print detailed event logging. -V , --version Print version information and exit. COMMANDS
<keyword> may be omitted from the execute line and sreport will execute in interactive mode. sreport will process commands as entered until explicitly terminated. exit Terminate the execution of sreport. Identical to the quit command. help Display a description of sreport options and commands. nonparsable Return output to normal after parsable or parsable2 has been set. parsable Output will be | delimited with an ending '|'. parsable2 Output will be | delimited without an ending '|'. quiet Print no warning or informational messages, only fatal error messages. quit Terminate the execution of sreport. Identical to the exit command. time <time_format> Specify the output time format. Time format options are case insensitive and may be abbreviated. The default format is Minutes. Supported time format options include: SecPer Seconds/Percentage of Total MinPer Minutes/Percentage of Total HourPer Hours/Percentage of Total Seconds Seconds Minutes Minutes Hours Hours Percent Percentage of Total verbose Enable detailed event logging. version Display the sreport version number. !! Repeat the last command executed. REPORT TYPES
Valid report types are: cluster <REPORT> <OPTIONS> job <REPORT> <OPTIONS> user <REPORT> <OPTIONS> <REPORT> options for each type include: cluster - AccountUtilizationByUser, UserUtilizationByAccount, UserUtilizationByWckey, Utilization, WCKeyUtilizationByUser job - SizesByAccount, SizesByAccountAndWcKey, SizesByWckey reservation - Utilization user - TopUsage REPORT DESCRIPTION
cluster AccountUtilizationByUser This report will display account utilization as it appears on the hierarchical tree. Starting with the specified account or the root account by default this report will list the underlying usage with a sum on each level. Use the 'tree' option to span the tree for better visibility. cluster UserUtilizationByAccount This report will display users by account in order of utilization without grouping multiple accounts by user into one, but display- ing them on separate lines. cluster UserUtilizationByWCKey This report will display users by wckey in order of utilization without grouping multiple wckey by user into one, but displaying them on separate lines. cluster Utilization This report will display total usage divided by Allocated, Down, Idle, and Reserved time for selected clusters. Reserved time refers to time that a job was waiting for resources after the job had become eligible. If the value is not of importance for you the number should be grouped with idle time. cluster WCKeyUtilizationByUser This report will display wckey utilization sorted by WCKey name for each user on each cluster. job SizesByAccount This report will dispay the amount of time used for job ranges specified by the 'grouping=' option. Only a single level in the tree is displayed defaulting to the root dir. If you specify other accounts with the 'account=' option sreport will use those accounts as the root account and you will receive the sub accounts for the accounts listed. job SizesByAccountAndWckey This report is very similar to SizesByAccount with the difference being each account is pair with wckeys so the identifier is account:wckey instead of just account so there will most likely be multiple accounts listed depending on the number of wckeys used. job SizesByWckey This report will dispay the amount of time for each wckey for job ranges specified by the 'grouping=' option. reservation Utilization This report will display total usage for reservations on the systems. user TopUsage Displays the top users on a cluster. Use the group option to group accounts together. The default is to have a different line for each user account combination. Each report type has various options... OPTIONS FOR ALL REPORT TYPES All_Clusters Use all monitored clusters. Default is local cluster. Clusters=<OPT> List of clusters to include in report. Default is local cluster. End=<OPT> Period ending for report. Default is 23:59:59 of previous day. Valid time formats are... HH:MM[:SS] [AM|PM] MMDD[YY] or MM/DD[/YY] or MM.DD[.YY] MM/DD[/YY]-HH:MM[:SS] YYYY-MM-DD[THH:MM[:SS]] Format=<OPT> Comma separated list of fields to display in report. When using the format option for listing various fields you can put a %NUMBER afterwards to specify how many characters should be printed. e.g. format=name%30 will print 30 characters of field name right justified. A -30 will print 30 characters left justified. Start=<OPT> Period start for report. Default is 00:00:00 of previous day. Valid time formats are... HH:MM[:SS] [AM|PM] MMDD[YY] or MM/DD[/YY] or MM.DD[.YY] MM/DD[/YY]-HH:MM[:SS] YYYY-MM-DD[THH:MM[:SS]] OPTIONS SPECIFICALLY FOR CLUSTER REPORTS Accounts=<OPT> When used with the UserUtilizationByAccount, or AccountUtilizationByUser, List of accounts to include in report. Default is all. Tree When used with the AccountUtilizationByUser report will span the accounts as they are in the hierarchy. Users=<OPT> When used with any report other than Utilization, List of users to include in report. Default is all. Wckeys=<OPT> When used with the UserUtilizationByWckey or WCKeyUtilizationByUser, List of wckeys to include in report. Default is all. OPTIONS SPECIFICALLY FOR JOB REPORTS Accounts=<OPT> List of accounts to use for the report Default is all. The SizesByAccount(*) report only displays 1 hierarchical level. If accounts are specified the next layer of accounts under those specified will be displayed, not the accounts specified. In the SizesByAc- count(*) reports the default for accounts is root. This explanation does not apply when ran with the FlatView option. FlatView When used with the SizesbyAccount(*) will not group accounts in a hierarchical level, but print each account where jobs ran on a separate line without any hierarchy. GID=<OPT> List of group ids to include in report. Default is all. Grouping=<OPT> Comma separated list of size groupings. (e.g. 50,100,150 would group job cpu count 1-49, 50-99, 100-149, > 150). grouping=indi- vidual will result in a single column for each job size found. Jobs=<OPT> List of jobs/steps to include in report. Default is all. Nodes=<OPT> Only show jobs that ran on these nodes. Default is all. Partitions=<OPT> List of partitions jobs ran on to include in report. Default is all. PrintJobCount When used with the Sizes report will print number of jobs ran instead of time used. Users=<OPT> List of users jobs to include in report. Default is all. Wckeys=<OPT> List of wckeys to use for the report. Default is all. The SizesbyWckey report all users summed together. If you want only certain users specify them them with the Users= option. OPTIONS SPECIFICALLY FOR RESERVATION REPORTS Names=<OPT> List of reservations to use for the report. Default is all. Nodes=<OPT> Only show reservations that used these nodes. Default is all. OPTIONS SPECIFICALLY FOR USER REPORTS Accounts=<OPT> List of accounts to use for the report. Default is all. Group Group all accounts together for each user. Default is a separate entry for each user and account reference. TopCount=<OPT> Used in the TopUsage report. Change the number of users displayed. Default is 10. Users=<OPT> List of users jobs to include in report. Default is all. FORMAT OPTIONS FOR EACH REPORT
FORMAT OPTIONS FOR CLUSTER REPORTS AccountUtilizationByUser: UserUtilizationByAccount: Accounts, Cluster, CPUCount, Login, Proper, Used UserUtilizationByWckey: WCKeyUtilizationByUser: Cluster, CPUCount, Login, Proper, Used, Wckey Utilization: Allocated, Cluster, CPUCount, Down, Idle, Overcommited, PlannedDown, Reported, Reserved FORMAT OPTIONS FOR JOB REPORTS SizesByAccount, SizesByAccountAndWckey: Account, Cluster SizesByWckey: Wckey, Cluster FORMAT OPTIONS FOR RESERVATION REPORTS Utilization: Allocated, Associations, Cluster, CPUCount, CPUTime, End, Idle, Name, Nodes, Start, TotalTime FORMAT OPTIONS FOR USER REPORTS TopUsage: Account, Cluster, Login, Proper, Used All commands and options are case-insensitive. EXAMPLES
sreport job sizesbyaccount sreport cluster utilization sreport user top sreport job sizesbyaccount All_Clusters users=gore1 account=environ PrintJobCount Report number of jobs by user gore1 within the environ account sreport cluster AccountUtilizationByUser cluster=zeus user=gore1 start=2/23/08 end=2/24/09 format=Accounts,Cluster,CPU- Count,Login,Proper,Used Report cluster account utilization with the specified fields during the specified 24 hour day of February 23, 2009, by user gore1 sreport cluster AccountUtilizationByUser cluster=zeus accounts=lc start=2/23/08 end=2/24/09 Report cluster account utilization by user in the LC account on cluster zeus sreport user topusage start=2/16/09 end=2/23/09 -t percent account=lc Report top usage in percent of the lc account during the specified week COPYING
Copyright (C) 2009-2010 Lawrence Livermore National Security. Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). CODE-OCEC-09-009. All rights reserved. This file is part of SLURM, a resource management program. For details, see <http://www.schedmd.com/slurmdocs/>. SLURM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SLURM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. SEE ALSO
sacct(1), slurmdbd(8) sreport 2.0 October 2010 SREPORT(1)
All times are GMT -4. The time now is 01:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy