3
3
* provides interface to read, write, update, and configure
5
5
*****************************************************************************
6
* Copyright (C) 2008 Lawrence Livermore National Security.
6
* Copyright (C) 2008-2009 Lawrence Livermore National Security.
7
7
* Copyright (C) 2002-2007 The Regents of the University of California.
8
8
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
9
9
* Written by Danny Auble <da@llnl.gov>
10
* CODE-OCEC-09-009. All rights reserved.
12
12
* This file is part of SLURM, a resource management program.
13
* For details, see <http://www.llnl.gov/linux/slurm/>.
13
* For details, see <https://computing.llnl.gov/linux/slurm/>.
14
* Please also read the included file: DISCLAIMER.
15
16
* SLURM is free software; you can redistribute it and/or modify it under
16
17
* the terms of the GNU General Public License as published by the Free
78
79
static struct option long_options[] = {
79
80
{"help", 0, 0, 'h'},
80
82
{"immediate",0, 0, 'i'},
83
{"noheader",0, 0, 'n'},
81
84
{"oneliner", 0, 0, 'o'},
82
{"no_header", 0, 0, 'n'},
83
85
{"parsable", 0, 0, 'p'},
84
86
{"parsable2", 0, 0, 'P'},
85
87
{"quiet", 0, 0, 'q'},
86
88
{"readonly", 0, 0, 'r'},
87
89
{"associations", 0, 0, 's'},
89
90
{"verbose", 0, 0, 'v'},
90
91
{"version", 0, 0, 'V'},
188
190
/* always do a rollback. If you don't then if there is an
189
191
* error you can not rollback ;)
192
194
db_conn = acct_storage_g_get_connection(false, 0, 1);
193
195
if(errno != SLURM_SUCCESS) {
194
error("sacctmgr: %m");
196
int tmp_errno = errno;
197
if((input_field_count == 2) &&
198
(!strncasecmp(argv[2], "Configuration", strlen(argv[1]))) &&
199
((!strncasecmp(argv[1], "list", strlen(argv[0]))) ||
200
(!strncasecmp(argv[1], "show", strlen(argv[0])))))
201
sacctmgr_list_config(false);
203
fprintf(stderr, "Problem talking to the database: %m\n");
197
206
my_uid = getuid();
405
416
} else if ((strncasecmp (argv[0], "show", MAX(command_len, 3)) == 0) ||
406
417
(strncasecmp (argv[0], "list", MAX(command_len, 3)) == 0)) {
407
418
_show_it((argc - 1), &argv[1]);
408
} else if (strncasecmp (argv[0], "modify", MAX(command_len, 1)) == 0) {
419
} else if (!strncasecmp (argv[0], "modify", MAX(command_len, 1))
420
|| !strncasecmp (argv[0], "update", MAX(command_len, 1))) {
409
421
_modify_it((argc - 1), &argv[1]);
410
422
} else if ((strncasecmp (argv[0], "delete",
411
423
MAX(command_len, 3)) == 0) ||
442
my_time = parse_time(argv[1], 1);
443
if(acct_storage_g_roll_usage(db_conn, my_time)
456
my_start = parse_time(argv[1], 1);
458
my_end = parse_time(argv[2], 1);
460
archive_data = atoi(argv[3]);
461
if(acct_storage_g_roll_usage(db_conn, my_start,
462
my_end, archive_data)
444
463
== SLURM_SUCCESS) {
445
464
if(commit_check("Would you like to commit rollup?")) {
446
465
acct_storage_g_commit(db_conn, 1);
586
605
} else if (strncasecmp (argv[0], "Clusters",
587
606
MAX(command_len, 1)) == 0) {
588
607
error_code = sacctmgr_list_cluster((argc - 1), &argv[1]);
608
} else if (strncasecmp (argv[0], "Configuration",
609
MAX(command_len, 1)) == 0) {
610
error_code = sacctmgr_list_config(true);
589
611
} else if (strncasecmp (argv[0], "QOS", MAX(command_len, 1)) == 0) {
590
612
error_code = sacctmgr_list_qos((argc - 1), &argv[1]);
591
613
} else if (strncasecmp (argv[0], "Transactions",
714
736
Valid <OPTION> values are: \n\
715
737
-h or --help: equivalent to \"help\" command \n\
716
738
-i or --immediate: commit changes immediately \n\
717
-n or --no_header: no header will be added to the beginning of output \n\
739
-n or --noheader: no header will be added to the beginning of output \n\
718
740
-o or --oneliner: equivalent to \"oneliner\" command \n\
719
741
-p or --parsable: output will be '|' delimited with a '|' at the end \n\
720
742
-P or --parsable2: output will be '|' delimited without a '|' at the end\n\
758
780
oneliner report output one record per line. \n\
759
781
parsable output will be | delimited with an ending '|'\n\
760
782
parsable2 output will be | delimited without an ending '|'\n\
761
readonly makes it so no modification can happen. \n\
762
783
quiet print no messages other than error messages. \n\
763
784
quit terminate this command. \n\
785
readonly makes it so no modification can happen. \n\
764
786
show same as list \n\
765
787
verbose enable detailed logging. \n\
766
788
version display tool version number. \n\
767
789
!! Repeat the last command entered. \n\
769
791
<ENTITY> may be \"account\", \"association\", \"cluster\", \n\
770
\"coordinator\", \"qos\", \"transaction\", \"user\", \n\
792
\"configuration\", \"coordinator\", \"qos\", \n\
793
\"transaction\", \"user\",or \"wckey\" \n\
773
795
<SPECS> are different for each command entity pair. \n\
774
796
list account - Clusters=, Descriptions=, Format=, Names=, \n\
789
811
delete account - Clusters=, Descriptions=, Names=, \n\
790
812
Organizations=, and Parents= \n\
792
list associations - Accounts=, Clusters=, Format=, IDs=, \n\
814
list associations - Accounts=, Clusters=, Format=, IDs=, \n\
793
815
Partitions=, Parent=, Tree, Users=, \n\
794
816
WithSubAccounts, WithDeleted, WOPInfo, \n\
795
817
and WOPLimits \n\
797
819
list cluster - Format=, Names= \n\
798
add cluster - Fairshare=, GrpCPUMins=, GrpCPUs=, GrpJobs=, \n\
799
GrpNodes=, GrpSubmitJob=, GrpWall=, MaxCPUMins=\n\
800
MaxJobs=, MaxNodes=, MaxWall=, and Name= \n\
801
modify cluster - (set options) Fairshare=, GrpCPUMins=, \n\
820
add cluster - Fairshare=, GrpCPUs=, GrpJobs=, \n\
821
GrpNodes=, GrpSubmitJob=, MaxCPUMins= \n\
822
MaxJobs=, MaxNodes=, MaxWall=, Name=, \n\
824
modify cluster - (set options) Fairshare=, \n\
802
825
GrpCPUs=, GrpJobs=, GrpNodes=, GrpSubmitJob=, \n\
803
GrpWall=, MaxCPUMins=, MaxJobs=, MaxNodes=, \n\
826
MaxCPUMins=, MaxJobs=, MaxNodes=, MaxWall=, \n\
805
828
(where options) Names= \n\
806
829
delete cluster - Names= \n\
841
864
list wckey - Clusters=, End=, Format=, IDs=, Names=, \n\
842
865
Start=, User=, and WCKeys= \n\
844
archive dump - Directory=, Jobs, PurgeJobsBefore=, \n\
845
PurgeStepsBefore=, Script=, and Steps \n\
867
archive dump - Directory=, Events, Jobs, PurgeEventMonths=, \n\
868
PurgeJobMonths=, PurgeStepMonths=, \n\
869
PurgeSuspendMonths=, Script=, Steps and Suspend\n\
847
871
archive load - File=, or Insert= \n\
849
873
Format options are different for listing each entity pair. \n\
875
One can get an number of characters by following the field option with \n\
876
a %%NUMBER option. i.e. format=name%%30 will print 30 chars of field name.\n\
851
878
Account - Account, CoordinatorList, Description, \n\
858
885
ParentID, ParentName, Partition, RawQOS, RGT, \n\
861
Cluster - Cluster, ControlHost, ControlPort, Fairshare \n\
862
GrpCPUMins, GrpCPUs, GrpJobs, GrpNodes, \n\
863
GrpSubmitJob, GrpWall, MaxCPUs, MaxCPUMins, \n\
864
MaxJobs, MaxNodes, MaxSubmitJobs, MaxWall \n\
888
Cluster - Cluster, ControlHost, ControlPort, CpuCount, \n\
889
Fairshare, GrpCPUs, GrpJobs, \n\
890
GrpNodes, GrpSubmitJob, MaxCPUs, \n\
891
MaxCPUMins, MaxJobs, MaxNodes, MaxSubmitJobs, \n\
892
MaxWall, NodeCount, NodeNames \n\
866
894
QOS - Description, ID, Name \n\