qmgr.8B 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635
  1. .\" Copyright (C) 1994-2018 Altair Engineering, Inc.
  2. .\" For more information, contact Altair at www.altair.com.
  3. .\"
  4. .\" This file is part of the PBS Professional ("PBS Pro") software.
  5. .\"
  6. .\" Open Source License Information:
  7. .\"
  8. .\" PBS Pro is free software. You can redistribute it and/or modify it under the
  9. .\" terms of the GNU Affero General Public License as published by the Free
  10. .\" Software Foundation, either version 3 of the License, or (at your option) any
  11. .\" later version.
  12. .\"
  13. .\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  14. .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15. .\" FOR A PARTICULAR PURPOSE.
  16. .\" See the GNU Affero General Public License for more details.
  17. .\"
  18. .\" You should have received a copy of the GNU Affero General Public License
  19. .\" along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. .\"
  21. .\" Commercial License Information:
  22. .\"
  23. .\" For a copy of the commercial license terms and conditions,
  24. .\" go to: (http://www.pbspro.com/UserArea/agreement.html)
  25. .\" or contact the Altair Legal Department.
  26. .\"
  27. .\" Altair’s dual-license business model allows companies, individuals, and
  28. .\" organizations to create proprietary derivative works of PBS Pro and
  29. .\" distribute them - whether embedded or bundled with other software -
  30. .\" under a commercial license agreement.
  31. .\"
  32. .\" Use of Altair’s trademarks, including but not limited to "PBS™",
  33. .\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  34. .\" trademark licensing policies.
  35. .\"
  36. .TH qmgr 8B "16 April 2018" Local "PBS Professional"
  37. .nf
  38. .SH NAME
  39. .B qmgr
  40. \- administrator's command interface for managing PBS
  41. .SH SYNOPSIS
  42. .B At shell command line:
  43. .br
  44. .B qmgr
  45. -c '<directive> [-a] [-e] [-n] [-z]'
  46. .br
  47. .B qmgr
  48. -c 'help [<help option>]'
  49. .br
  50. .B qmgr
  51. <return>
  52. .br
  53. .B qmgr
  54. --version
  55. .br
  56. .B In qmgr session:
  57. .br
  58. <directive> [-a] [-e] [-n] [-z]
  59. .br
  60. help <help option>
  61. .SH DESCRIPTION
  62. The PBS manager command,
  63. qmgr,
  64. provides a command-line interface to parts of PBS. The
  65. .B qmgr
  66. command is used to create or delete queues,
  67. vnodes, resources, and hooks, to set or change vnode, queue, hook,
  68. server, or scheduler attributes and resources, and to view information
  69. about hooks, queues, vnodes, resource definitions, the server, and
  70. schedulers.
  71. For a list of quick summaries of information about syntax, commands,
  72. attributes, operators, names, and values, type "help" or "?" at the
  73. qmgr prompt. See "Printing Usage Information", below.
  74. .B Modes of Operation
  75. .br
  76. When you type qmgr -c '<directive>',
  77. .B qmgr
  78. performs its
  79. task and then exits.
  80. When you type qmgr <return>,
  81. .B qmgr
  82. starts a session and presents you with its command line prompt. The
  83. .B qmgr
  84. command then reads directives etc. from standard input; see
  85. "Directive Syntax", below. You can edit the command
  86. line; see "Reusing and Editing the qmgr Command
  87. Line", below. For a qmgr prompt, type:
  88. .br
  89. .B \ \ \ qmgr <return>
  90. .br
  91. You will see the qmgr prompt:
  92. .br
  93. .B \ \ \ Qmgr:
  94. .br
  95. .B Required Privilege
  96. .br
  97. The qmgr command requires different levels of privilege depending on
  98. the operation to be performed.
  99. All users can list or print attributes except for hook attributes.
  100. PBS Operator or Manager privilege is required in order to set or
  101. change vnode, queue, server, or scheduler attributes. PBS Manager
  102. privilege is required in order to create or delete queues, vnodes, and
  103. resources.
  104. Under Linux, root privilege is required in order to create hooks, or
  105. operate on hooks or the
  106. .I job_sort_formula
  107. server attribute. Under
  108. Windows, this must be done from the installation account.
  109. For domained environments, the installation account must be a local
  110. account that is a member of the local Administrators group on the
  111. local computer. For standalone environments, the installation account
  112. must be a local account that is a member of the local Administrators
  113. group on the local computer.
  114. Users without manager or operator privilege cannot view custom
  115. resources or resource definitions which were created to be invisible
  116. to users.
  117. .B When To Run qmgr At Server Host
  118. .br
  119. When operating on hooks or on the
  120. .I job_sort_formula
  121. server attribute,
  122. the qmgr command must be run at the server host.
  123. .B Reusing and Editing the qmgr Command Line
  124. .br
  125. You can reuse or edit qmgr command lines. The qmgr command maintains
  126. a history of commands entered, up to a maximum of 500. You can use
  127. the 'history' command to see a numbered list of commands, and the !<n>
  128. command to execute the line whose number is n. You must not put any
  129. spaces between the bang ("!") and the number. For example, to execute
  130. the 123rd command, type the following:
  131. .br
  132. .B \ \ \ !123
  133. .br
  134. You can see the last m commands by typing 'history m'. For example,
  135. to see the last 6 commands, type the following:
  136. .br
  137. .B \ \ \ history 6
  138. .br
  139. You can use the up and down arrows to navigate through the command
  140. history list, and the left and right arrows to navigate within a
  141. command line. Within a command line, you can use emacs commands to
  142. move forward and backward, and delete characters.
  143. You can edit the qmgr command line using the backspace and delete
  144. keys, and you can insert characters anywhere in a command line.
  145. History is maintained across qmgr sessions, so that if you start qmgr,
  146. then exit, then restart it, you can reuse your commands from the
  147. previous session. If you exit qmgr and then restart it, the command
  148. lines are renumbered.
  149. If you enter the same command line more than once in a row, only one
  150. occurrence is recorded in the history. If you enter the same command
  151. line multiple times, but intersperse other command lines after each
  152. line, each occurrence is recorded.
  153. Each user's history is unique to that user on that host.
  154. In the case where an account runs concurrent sessions, the most recent
  155. logout of a session overwrites history from previous logouts. For
  156. example, if two people are both logged in as root and using qmgr, the
  157. second person to log out overwrites the history file.
  158. .B The qmgr History File
  159. .br
  160. The qmgr command stores and retrieves its history. First, it tries to
  161. write its history in the ${HOME}/.pbs_qmgr_history file. If this file
  162. or directory location is not writable, the command stores its history
  163. in $PBS_HOME/spool/.pbs_qmgr_history_<user name>. If this file is
  164. also not writable, the following happens:
  165. The qmgr command prints error messages once at qmgr startup
  166. The qmgr command cannot provide history across qmgr sessions
  167. .SH OPTIONS TO qmgr
  168. The following table lists the options to qmgr:
  169. .nf
  170. .B Option \ \ \ \ \ \ \ \ \ \ \ Action
  171. -----------------------------------------------------------------------
  172. <return> Starts a qmgr session and presents user with
  173. qmgr prompt
  174. -----------------------------------------------------------------------
  175. -a Aborts qmgr on any syntax errors or any requests
  176. rejected by a server.
  177. -----------------------------------------------------------------------
  178. -c '<directive>' Executse a single command (directive) and exit qmgr.
  179. The directive must be enclosed in single or double
  180. quote marks, for example:
  181. .B \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ qmgr -c "print server"
  182. -----------------------------------------------------------------------
  183. -c 'help Prints out usage information.
  184. [<help option>]' See "Printing Usage Information"
  185. -----------------------------------------------------------------------
  186. -e Echoes all commands to standard output
  187. -----------------------------------------------------------------------
  188. -n No commands are executed; syntax checking only
  189. is performed
  190. -----------------------------------------------------------------------
  191. -z No errors are written to standard error
  192. -----------------------------------------------------------------------
  193. --version The qmgr command returns its PBS version information
  194. and exits. This option can only be used alone
  195. -----------------------------------------------------------------------
  196. .SH Directives
  197. A qmgr
  198. .I directive
  199. is a command together with the object(s) to be operated on, the
  200. attribute(s) belonging to the object that is to be changed, the
  201. operator, and the value(s) the attribute(s) will take. In the case of
  202. resources, you can set the type and/or flag(s).
  203. .B Directive Syntax
  204. .br
  205. A directive is terminated by a newline or a semicolon (";"). Multiple
  206. directives may be entered on a single line. A directive may extend
  207. across lines by escaping the newline with a backslash ("\").
  208. Comments begin with the "#" character and continue to the end of the
  209. line. Comments and blank lines are ignored by qmgr.
  210. .B Server, Scheduler, Queue, Vnode Directives
  211. .br
  212. Syntax for operating on servers, schedulers, queues, vnodes:
  213. .RS 3
  214. .I <command> <object type> [<object name(s)>] [<attribute> <operator> <value>[,<attribute> <operator> <value>,...]]
  215. .RE
  216. .B Resource Directives
  217. .br
  218. Syntax for operating on resources:
  219. .nf
  220. .RS 3
  221. .I <command> <resource name> [<resource name> ...] [type = <type>],[,flag = <flag(s)>]
  222. .RE
  223. .fi
  224. For information about resources, see
  225. .I pbs_resources.7B.
  226. .B Hook Directives
  227. .br
  228. Syntax for operating on hooks:
  229. .nf
  230. .RS 3
  231. .I import hook <hook name> application/x-python <content-encoding> (<input file> | -)
  232. .I import hook <hook name> application/x-config <content-encoding> (<input file> | -)
  233. .I export hook <hook name> <content-type> <content-encoding> [<output file>]
  234. .fi
  235. .RE
  236. .B Using Directives
  237. .br
  238. You can use a directive from the shell command line or from within
  239. the qmgr session.
  240. To use a directive from the command line, enclose the command and its
  241. arguments in single or double quotes.
  242. .br
  243. .I \ \ \ qmgr -c '<command> <command arguments>'
  244. For example, to have qmgr print server information and exit:
  245. .br
  246. .B \ \ \ qmgr -c "print server"
  247. To use a directive from within the qmgr session, first start qmgr:
  248. .br
  249. .I \ \ \ qmgr <return>
  250. The qmgr session presents a qmgr prompt:
  251. .br
  252. .B \ \ \ Qmgr:
  253. At the qmgr prompt, enter the directive (a command and its arguments).
  254. For example, to enter the same "print server" directive:
  255. .br
  256. .B \ \ \ Qmgr: print server
  257. .B Commands Used in Directives
  258. .br
  259. Commands can be abbreviated to their minimum unambiguous form.
  260. Commands apply to all target objects unless explicitly limited. The
  261. following table lists the commands, briefly tells what they do, and
  262. lists the section with the full description:
  263. .nf
  264. .B Command \ Abbr \ Effect \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ See Description
  265. -----------------------------------------------------------------------
  266. active a Specifies active objects "Making Objects Active"
  267. -----------------------------------------------------------------------
  268. create c Creates object "Creating Objects (Server,
  269. Scheduler, Vnode, Queue,
  270. Hook)"
  271. -----------------------------------------------------------------------
  272. delete d Deletes object "Deleting Objects"
  273. -----------------------------------------------------------------------
  274. exit Exits (quits) the qmgr
  275. session
  276. -----------------------------------------------------------------------
  277. export e Exports hook "Exporting Hooks"
  278. -----------------------------------------------------------------------
  279. help h|? Prints usage to stdout "Printing Usage Information"
  280. -----------------------------------------------------------------------
  281. import i Imports hook or "Importing Hooks"
  282. configuration file "Importing Hook
  283. Configuration Files"
  284. -----------------------------------------------------------------------
  285. list l Lists object attributes "Listing Objects and Their
  286. and their values Attributes"
  287. -----------------------------------------------------------------------
  288. print p Prints creation and "Printing Creation and
  289. configuration commands Configuration Commands"
  290. -----------------------------------------------------------------------
  291. quit q Quits (exits) the qmgr
  292. session
  293. -----------------------------------------------------------------------
  294. set s Sets value of attribute "Setting Attribute and
  295. Resource Values"
  296. -----------------------------------------------------------------------
  297. unset u Unsets value of attribute "Unsetting Attribute and
  298. Resource Values"
  299. -----------------------------------------------------------------------
  300. .SH Arguments to Directive Commands
  301. .B Object Arguments to Directive Commands
  302. .br
  303. The qmgr command can operate on objects (servers, schedulers, queues, vnodes,
  304. resources, hooks, and built-in hooks). Each of these can be
  305. abbreviated inside a directive. The following table lists the objects
  306. and their abbreviations:
  307. .nf
  308. .B Object \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Can Be Created or \ \ \ \ \ Can Be
  309. .B Name \ \ \ \ \ Abbr \ Object \ \ \ Deleted By: \ \ \ \ \ \ \ \ \ \ \ \ Modified By:
  310. -----------------------------------------------------------------------
  311. server s server No one (created Administrator,
  312. at installation) Operator, Manager
  313. -----------------------------------------------------------------------
  314. sched sc default No one (created Administrator,
  315. scheduler at installation) Operator, Manager
  316. --------------------------------------------------------
  317. multisched Administrator, Manager Administrator,
  318. Operator, Manager
  319. -----------------------------------------------------------------------
  320. queue q queue Administrator, Administrator,
  321. Operator, Manager Operator, Manager
  322. -----------------------------------------------------------------------
  323. node n vnode Administrator, Administrator,
  324. Operator, Manager Operator, Manager
  325. -----------------------------------------------------------------------
  326. resource r resource Administrator, Manager Administrator,
  327. Manager
  328. -----------------------------------------------------------------------
  329. hook h hook Linux: root Linux: root
  330. Windows: installation Windows: installation
  331. account account
  332. -----------------------------------------------------------------------
  333. pbshook p built-in No one (created Linux: root
  334. hook at installation)
  335. Windows: installation
  336. account
  337. -----------------------------------------------------------------------
  338. .B Specifying Active Server
  339. .br
  340. The qmgr command operates on objects (queues, vnodes, etc.) at the
  341. active server. There is always at least one active server; the
  342. default server is the active server unless other servers have been
  343. made active. The default server is the server managing the host where
  344. the qmgr command runs, meaning it is the server specified in that
  345. host's pbs.conf file. Server names have the following format:
  346. .br
  347. .I \ \ \ <hostname>[:<port number>]
  348. .br
  349. where
  350. .I hostname
  351. is the fully-qualified domain name of the host on which
  352. the server is running and
  353. .I port number
  354. is the port number to which to
  355. connect. If
  356. .I port number
  357. is not specified, the default port number, 15001, is used.
  358. To specify the default server:
  359. .br
  360. .I \ \ \ @default
  361. To specify a named server:
  362. .br
  363. .I \ \ \ @<server name>
  364. To specify all active servers:
  365. .br
  366. .I \ \ \ @active
  367. .B Using Lists of Object Names
  368. .br
  369. In a qmgr directive,
  370. .I object name(s)
  371. is a list of one or more names of
  372. specific objects. The administrator specifies the name of an object
  373. when creating the object. The name list is in the form:
  374. .br
  375. .I \ \ \ <object name>[@<server>][,<object name>[@<server>] ...]
  376. .br
  377. where
  378. .I server
  379. is replaced in the directive with "default", "active", or
  380. the name of the server. The name list must conform to the following:
  381. .RS 3
  382. There must be no space between the object name and the @ sign.
  383. Name lists must not contain white space between entries.
  384. All objects in a list must be of the same type.
  385. Node attributes cannot be used as vnode names.
  386. .RE
  387. .B Specifying Object Type and Name
  388. .br
  389. You can specify objects in the following ways:
  390. To act on the active objects of the named type, at the active server:
  391. .RS 3
  392. .I <object type>
  393. For example, to list all active vnodes, along with their attributes,
  394. at the active server:
  395. .br
  396. .B Qmgr: list node
  397. .RE
  398. To act on the active objects of the named type, at a specified server:
  399. .RS 3
  400. .I <object type> @<server name>
  401. (note space before @ sign)
  402. For example, to list all active vnodes at the default server, along
  403. with their attributes:
  404. .br
  405. .B Qmgr: list node @default
  406. For example, to print out all queues at the default server, along with
  407. their attributes:
  408. .br
  409. .B qmgr -c "print queue @default"
  410. .RE
  411. To act on a specific named object:
  412. .RS 3
  413. .I <object type> <object name>
  414. For example, to list Node1 and its attributes:
  415. .br
  416. .B Qmgr: list node Node1
  417. To list queues workq, slowq, and fastq at the active server:
  418. .br
  419. .B Qmgr: list queue workq,slowq,fastq
  420. .RE
  421. To act on the named object at the specified server:
  422. .RS 3
  423. .I <object type> <object name>@<server name>
  424. For example, to list Node1 at the default server, along with the
  425. attributes of Node1:
  426. .br
  427. .B Qmgr: list node Node1@default
  428. To list queues Queue1 at the default server, Queue2 at Server2, and
  429. Queue3 at the active server:
  430. .br
  431. .B Qmgr: list queue Queue1@default,Queue2@Server2,Queue3@active
  432. .RE
  433. .B Operators in Directive Commands
  434. .br
  435. In a qmgr directive,
  436. .I operator
  437. is the operation to be performed with
  438. the attribute and its value. Operators are listed here:
  439. .nf
  440. .B Operator \ \ Effect
  441. -----------------------------------------------------------------------
  442. = Sets the value of the attribute or resource. If the
  443. attribute or resource has an existing value, the current
  444. value is replaced with the new value.
  445. -----------------------------------------------------------------------
  446. += Increases the current value of the attribute or resource by
  447. the amount in the new value. When used for a string array,
  448. adds the new value as another string after a comma.
  449. -----------------------------------------------------------------------
  450. -= Decreases the current value of the attribute or resource by
  451. the specified amount. When used for a string array, removes
  452. the first matching string.
  453. -----------------------------------------------------------------------
  454. Example: Set routing destination for queue Queue1 to be Dest1:
  455. .br
  456. .B \ \ \ Qmgr: set queue route_destinations = Dest1
  457. Example: Add new routing destination for queue Queue1:
  458. .br
  459. .B \ \ \ Qmgr: set queue route_destinations += Dest2
  460. Example: Remove new routing destination for queue Queue1:
  461. .br
  462. .B \ \ \ Qmgr: set queue route_destinations -= Dest2
  463. When setting numerical resource values, you can use only the equal sign ("=").
  464. .B Windows Requirements For Directive Arguments
  465. .br
  466. Under Windows, use double quotes when specifying arguments to qmgr.
  467. For example:
  468. .br
  469. Qmgr: import hook hook1 application/x-python default \*(lq\\Documents and Settings\\pbsuser1\\hook1.py\\\*(rq
  470. .br
  471. or
  472. .br
  473. qmgr -c 'import hook hook1 application/x-python default \*(lq\\Documents and Settings\\pbsuser1\\hook1.py\\\*(rq'
  474. .SH Operating on Objects (Server, Scheduler, Vnode, Queue, Hook)
  475. .B Making Objects Active
  476. .br
  477. Making objects active is a way to set up a list of objects, all of the
  478. same type, on which you can then use a single command. For example,
  479. if you are going to set the same attribute to the same value on
  480. several vnodes, you can make all of the target vnodes active before
  481. using a single command to set the attribute value, instead of having
  482. to give the command once for each vnode. You can make any type of
  483. object active except for resources or hooks.
  484. When an object is active, it is acted upon when you specify its type
  485. but do not specify names. When you specify any object names in a
  486. directive, active objects are not operated on unless they are named in
  487. the directive.
  488. You can specify a list of active objects for each type of object. You
  489. can have active objects of multiple types at the same time. The
  490. active objects of one type have no effect on whether objects of
  491. another type are active.
  492. Objects are active only until the qmgr command is exited, so this
  493. feature can be used only at the qmgr prompt.
  494. Each time you make any objects active at a given server, that list of
  495. objects replaces any active objects of the same kind at that server.
  496. For example, if you have four queues at a particular server, and you
  497. make Q1 and Q2 active, then later make Q3 and Q4 active, the result is
  498. that Q3 and Q4 are the only active queues.
  499. You can make different objects be active at different servers
  500. simultaneously. For example, you can set vnodes N1 and N2 at the
  501. default server, and vnodes N3 and N4 at server Server2 to be active at
  502. the same time.
  503. To make all objects inactive, quit qmgr. When you quit qmgr, any
  504. object that was active is no longer active.
  505. .B Using the active Command
  506. .br
  507. To make the named object(s) of the specified type active:
  508. .RS 3
  509. .I active <object type> [<object name>[,<object name> ...]]
  510. Example: To make queue Queue1 active:
  511. .br
  512. .B Qmgr: active queue Queue1
  513. Example: To make queues Queue1 and Queue2 at the active server be
  514. active, then enable them:
  515. .br
  516. .B Qmgr: active queue Queue1,Queue2
  517. .br
  518. .B Qmgr: set queue enabled=True
  519. Example: To make queue Queue1 at the default server and queue Queue2
  520. at Server2 be active:
  521. .br
  522. .B Qmgr: active queue Queue1@default,Queue2@Server2
  523. Example: To make vnodes N1, N2, N3, and N4 active, and then give them
  524. all the same value for their
  525. .I max_running
  526. attribute:
  527. .br
  528. .B Qmgr: active node N1,N2,N3,N4
  529. .br
  530. .B Qmgr: set node max_running = 2
  531. .RE
  532. To make all object(s) of the specified type at the specified server
  533. active:
  534. .RS 3
  535. .I active <object type> @<server name>
  536. (note space before @ sign)
  537. Example: To make all queues at the default server active:
  538. .br
  539. .B Qmgr: active queue @default
  540. Example: To make all vnodes at server Server2 active:
  541. .br
  542. .B Qmgr: active node @Server2
  543. .RE
  544. To report which objects of the specified type are active:
  545. .RS 3
  546. .I active <object type>
  547. The qmgr command prints a list of names of active objects of the
  548. specified type to stdout.
  549. .RE
  550. .B Creating Objects (Server, Scheduler, Vnode, Queue, Hook)
  551. .br
  552. To create one new object of the specified type for each name, and give
  553. it the specified name:
  554. .RS 3
  555. .I create <object type> <object name>[,<object name> ...] [[<attribute> = <value>] [,<attribute> = <value>] ...]
  556. .RE
  557. Can be used only with multischeds, queues, vnodes, resources, and hooks. Cannot be
  558. used with built-in hooks.
  559. .RS 3
  560. For example, to create a multisched named multisched_1 at the active server:
  561. .br
  562. .B Qmgr: create sched multisched_1
  563. For example, to create a queue named Q1 at the active server:
  564. .br
  565. .B Qmgr: create queue Q1
  566. For example, to create a vnode named N1 and a vnode named N2:
  567. .br
  568. .B Qmgr: create node N1,N2
  569. For example, to create queue Queue1 at the default server and queue
  570. Queue2 at Server2:
  571. .br
  572. .B Qmgr: create queue Queue1@default,Queue2@Server2
  573. For example, to create vnodes named N1, N2, N3, and N4 at the active
  574. server, and to set their Mom attribute to Host1 and their
  575. .I max_running
  576. attribute to 1:
  577. .br
  578. .B Qmgr: create node N1,N2,N3,N4 Mom=Host1, max_running = 1
  579. For example, to create a host-level consumable string resource named "foo":
  580. .br
  581. .B qmgr -c "create resource foo type=string,flag=nh"
  582. .RE
  583. All objects of the same type at a server must have unique names. For
  584. example, each queue at server Server1 must have a unique name.
  585. Objects at one server can have the same name as objects at another
  586. server.
  587. You can create multiple objects of the same type with a single
  588. command. You cannot create multiple types of objects in a single
  589. command.
  590. To create multiple resources of the same type
  591. and flag, separate each resource name with a comma:
  592. .RS 3
  593. .I qmgr -c "create resource <resource>[,<resource> ...] type=<type>,flag=<flag(s)>"
  594. .RE
  595. .B Examples of Creating Objects
  596. .br
  597. Example: Create queue:
  598. .RS 3
  599. .B Qmgr: create queue fast priority=10,queue_type=e,enabled = true,max_running=0
  600. .RE
  601. Example: Create queue, set resources:
  602. .RS 3
  603. .B Qmgr: create queue little
  604. .br
  605. .B Qmgr: set queue little resources_max.mem=8mw,resources_max.cput=10
  606. .RE
  607. .B Deleting Objects
  608. .br
  609. To delete the named object(s):
  610. .RS 3
  611. .I delete <object type> <object name>[,<object name> ...]
  612. When you delete more than one object, do not put a space after a comma.
  613. Can be used only with queues, vnodes, resources, and hooks. Cannot be
  614. used with built-in hooks.
  615. For example, to delete queue Q1 at the active server:
  616. .br
  617. .B Qmgr: delete queue Q1
  618. For example, to delete vnodes N1 and N2 at the active server:
  619. .br
  620. .B Qmgr: delete node N1,N2
  621. For example, to delete queue Queue1 at the default server and queue
  622. Queue2 at Server2:
  623. .br
  624. .B Qmgr: delete queue Queue1@default,Queue2@Server2
  625. For example, to delete resource "foo" at the active server:
  626. .br
  627. .B Qmgr: delete resource foo
  628. .RE
  629. To delete the active objects of the specified type:
  630. .RS 3
  631. .I delete <object type>
  632. For example, to delete the active queues:
  633. .br
  634. .B Qmgr: delete queue
  635. .RE
  636. To delete the active objects of the specified type at the specified
  637. server:
  638. .RS 3
  639. .I delete <object type> @<server name>
  640. For example, to delete the active queues at server Server2:
  641. .br
  642. .B Qmgr: delete queue @Server2
  643. .RE
  644. You can delete multiple objects of the same type with a single
  645. command. You cannot delete multiple types of objects in a single
  646. command. To delete multiple resources, separate the
  647. resource names with commas.
  648. .RS 3
  649. For example:
  650. .br
  651. .B Qmgr: delete resource r1,r2
  652. .RE
  653. You cannot delete a resource that is requested by a job or
  654. reservation, or that is set on a server, queue, or vnode.
  655. .SH Operating on Attributes and Resources
  656. You can specify attributes and resources for named objects or for all
  657. objects of a type.
  658. .B Setting Attribute and Resource Values
  659. .br
  660. To set the value of the specified attribute(s) for the named
  661. object(s):
  662. .RS 3
  663. .I set <object type> <object name>[,<object name> ...] <attribute> = <value> [,<attribute> = <value> ...]
  664. .RE
  665. Each specified attribute is set for each named object, so if you
  666. specify three attributes and two objects, both objects get all three
  667. attributes set.
  668. To set the attribute value for all active objects when there are
  669. active objects of the type specified:
  670. .br
  671. .I \ \ \ set <object type> <attribute> = <value>
  672. To set the attribute value for all active objects at the specified
  673. server when there are active objects of the type specified:
  674. .RS 3
  675. .I set <object type> @<server name> <attribute> = <value>
  676. For example, to set the amount of memory on a vnode:
  677. .br
  678. .B Qmgr: set node Vnode1 resources_available.mem = 2mb
  679. .RE
  680. If the attribute is one which describes a set of resources such as
  681. .I resources_available, resources_default, resources_max, resources_used,
  682. etc., the attribute is specified in the form:
  683. .br
  684. .I \ \ \ <attribute name>.<resource name>
  685. You can have spaces between attribute=value pairs.
  686. .B Examples of Setting Attribute Values
  687. .br
  688. Increase limit on queue:
  689. .RS 3
  690. .B Qmgr: set queue fast max_running +=2
  691. .RE
  692. Set software resource on mynode:
  693. .RS 3
  694. .B Qmgr: set node mynode resources_available.software = "myapp=/tmp/foo"
  695. .RE
  696. Set limit on queue:
  697. .RS 3
  698. .B Qmgr: set queue max_running = 10
  699. .RE
  700. Set vnode offline:
  701. .RS 3
  702. .B Qmgr: set node state = "offline"
  703. .RE
  704. .B Unsetting Attribute and Resource Values
  705. .br
  706. You can use the qmgr command to unset attributes of any object, except
  707. for the
  708. .I type
  709. attribute of a built-in hook.
  710. To unset the value of the specified attributes of the named object(s):
  711. .nf
  712. .RS 3
  713. .I unset <object type> <object name>[,<object name> ...] <attribute>[,<attribute>...]
  714. .RE
  715. To unset the value of specified attributes of active objects:
  716. .br
  717. .I \ \ \ unset <object type> <attribute>[,<attribute>...]
  718. To unset the value of specified attributes of the named object:
  719. .br
  720. .I \ \ \ unset <object type> <object name> <attribute>[,<attribute>...]
  721. To unset the value of specified attributes of the named object:
  722. .br
  723. .I \ \ \ unset <object type> @<server name> <attribute>[,<attribute>...]
  724. .B Example of Unsetting Attribute Value
  725. .br
  726. Unset limit on queue
  727. .br
  728. .B \ \ \ Qmgr: unset queue fast max_running
  729. .B Caveats and Restrictions for Setting Attribute and Resource Values
  730. .br
  731. If the value includes whitespace, commas or other special characters,
  732. such as the # character, the value string must be enclosed in single
  733. or double quotes. For example:
  734. .RS 3
  735. .B Qmgr: set node Vnode1 comment="Node will be taken offline Friday at 1:00 for memory upgrade."
  736. .RE
  737. You can set or unset attribute values for only one type of object in each command.
  738. You can use the qmgr command to set attributes of any object, except
  739. for the
  740. .I type
  741. attribute of a built-in hook.
  742. You can have spaces between attribute names.
  743. Attribute and resource values must conform to the format for the
  744. attribute or resource type.
  745. Most of a vnode's attributes may be set using qmgr. However, some
  746. must be set on the individual execution host in local vnode definition
  747. files, NOT by using qmgr. See the
  748. .I PBS Professional Administrator's Guide.
  749. .B Setting Resource Type and Flag(s)
  750. .br
  751. You can use the qmgr command to set or unset the type and flag(s) for
  752. resources.
  753. Resource types can be the following:
  754. .RS 3
  755. string
  756. .br
  757. boolean
  758. .br
  759. string_array
  760. .br
  761. long
  762. .br
  763. size
  764. .br
  765. float
  766. .RE
  767. To set a resource type:
  768. .br
  769. .I \ \ \ set resource <resource name> type = <type>
  770. Sets the type of the named resource to the specified type. For
  771. example:
  772. .br
  773. .B \ \ \ qmgr -c "set resource foo type=string_array"
  774. .B Resource Accumulation Flags
  775. The resource accumulation flag for a resource can be one of the
  776. following:
  777. .B Flag \ \ \ \ \ \ \ Meaning
  778. -----------------------------------------------------------------------
  779. (no flags) Indicates a queue-level or server-level resource that is
  780. not consumable.
  781. -----------------------------------------------------------------------
  782. fh The amount is consumable at the host level for only the
  783. first vnode allocated to the job (vnode with first task.)
  784. Must be consumable or time-based. Cannot be used with
  785. Boolean or string resources.
  786. This flag specifies that the resource is accumulated at the
  787. first vnode, meaning that the value of
  788. resources_assigned.<resource> is incremented only at the
  789. first vnode when a job is allocated this resource or when a
  790. reservation requesting this resource on this vnode starts.
  791. -----------------------------------------------------------------------
  792. h Indicates a host-level resource. Used alone, means that the
  793. resource is not consumable. Required for any resource that
  794. will be used inside a select statement. This flag selects
  795. hardware. This flag indicates that the resource must be
  796. requested inside of a select statement.
  797. Example: for a Boolean resource named "green":
  798. .B \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ green type=boolean, flag=h
  799. -----------------------------------------------------------------------
  800. nh The amount is consumable at the host level, for all vnodes
  801. assigned to the job. Must be consumable or time-based.
  802. Cannot be used with Boolean or string resources.
  803. This flag specifies that the resource is accumulated at the
  804. vnode level, meaning that the value of
  805. resources_assigned.<resource> is incremented at relevant
  806. vnodes when a job is allocated this resource or when a
  807. reservation requesting this resource on this vnode starts.
  808. This flag is not used with dynamic consumable resources.
  809. A scheduler will not oversubscribe dynamic consumable
  810. resources.
  811. -----------------------------------------------------------------------
  812. q The amount is consumable at the queue and server level.
  813. When a job is assigned one unit of a resource with this
  814. flag, the resources_assigned.<resource> attribute at the
  815. server and any queue is incremented by one. Must be
  816. consumable or time-based.
  817. This flag specifies that the resource is accumulated at the
  818. queue and server level, meaning that the value of
  819. resources_assigned.<resource> is incremented at each queue
  820. and at the server when a job is allocated this resource.
  821. When a reservation starts, allocated resources are added to
  822. the server's resources_assigned attribute.
  823. This flag is not used with dynamic consumable resources.
  824. A scheduler will not oversubscribe dynamic consumable
  825. resources.
  826. -----------------------------------------------------------------------
  827. .B Resource Permission Flags
  828. The permission flag for a resource can be one of the following:
  829. .B Flag \ \ \ \ \ \ \ Meaning
  830. -----------------------------------------------------------------------
  831. (no flag) Users can view and request the resource, and qalter a
  832. resource request for this resource.
  833. -----------------------------------------------------------------------
  834. i "Invisible". Users cannot view or request the resource.
  835. Users cannot qalter a resource request for this resource.
  836. -----------------------------------------------------------------------
  837. r "Read only". Users can view the resource, but cannot
  838. request it or qalter a resource request for this resource.
  839. -----------------------------------------------------------------------
  840. To set resource flags, concatenate the flags you want without spaces
  841. or commas.
  842. To set the flag(s) of the named resource to the specified flag(s):
  843. .RS 3
  844. .I set resource <resource name> flag = <flag(s)>
  845. For example:
  846. .br
  847. .B qmgr -c "set resource foo flag=nhi"
  848. .RE
  849. To set both type and flag(s):
  850. .RS 3
  851. .I set resource <resource name> type=<type>, flag = <flag(s)>
  852. Sets the type and flag(s) of the named resource to the specified type
  853. and flag(s). For example:
  854. .br
  855. .B qmgr -c "set resource foo type=long,flag=nhi"
  856. .RE
  857. You can set multiple resources by separating the names with commas.
  858. .RS 3
  859. For example:
  860. .br
  861. .B qmgr -c "set resource r1,r2 type=long"
  862. .RE
  863. You cannot set the type for a resource that is requested by a job or
  864. reservation, or set on a server, queue, or vnode.
  865. You cannot set the flag(s) to h, nh, fh, or q for a resource that is
  866. requested by a job or reservation.
  867. .B Unsetting Resource Flag(s)
  868. .br
  869. You can use the qmgr command to unset the flag(s) for resources.
  870. To unset the flag(s) of the named resource:
  871. .RS 3
  872. .I unset resource <resource name> flag
  873. For example:
  874. .br
  875. .B qmgr -c "unset resource foo flag"
  876. .RE
  877. You can unset the flag(s) of multiple resources by separating the
  878. resource names with commas.
  879. .RS 3
  880. For example:
  881. .br
  882. .B qmgr -c "unset resource r1,r2 flag"
  883. .RE
  884. You cannot unset the type for a resource.
  885. You cannot unset the flag(s) for a resource that is requested by a job
  886. or reservation, or set on any server, queue, or vnode.
  887. .SH Viewing Object, Attribute, and Resource Information
  888. .B Listing Objects and Their Attributes
  889. .br
  890. You can use the qmgr command to list attributes of any object,
  891. including attributes at their default values.
  892. To list the attributes, with associated values, of the named
  893. object(s):
  894. .RS 3
  895. .I list <object type> <object name>[,<object name> ...]
  896. .RE
  897. To list values of the specified attributes of the named object:
  898. .RS 3
  899. .I list <object type> <object name> <attribute name>[, <attribute name>]...
  900. .RE
  901. To list attributes, with associated values, of active objects of the
  902. specified type at the active server:
  903. .br
  904. .I \ \ \ list <object type>
  905. To list all objects of the specified type at the specified server,
  906. with their attributes and the values associated with the attributes:
  907. .br
  908. .I \ \ \ list <object type> @<server name>
  909. To list attributes of the active server:
  910. .RS 3
  911. .I list server
  912. .br
  913. If no server other than the default server has been made active,
  914. lists attributes of the default server (it is the active server).
  915. .RE
  916. To list attributes of the specified server:
  917. .br
  918. .I \ \ \ list server <server name>
  919. To list all attributes of all schedulers:
  920. .br
  921. .I \ \ \ list sched
  922. To list all attributes of the specified scheduler:
  923. .br
  924. .I \ \ \ list sched <scheduler name>
  925. To list all hooks, along with their attributes:
  926. .br
  927. .I \ \ \ list hook
  928. To list attributes of the specified hook:
  929. .br
  930. .I \ \ \ list hook <hook name>
  931. .B Examples of Listing Objects and Their Attributes
  932. .br
  933. List serverA's schedulers' attributes:
  934. .br
  935. .B \ \ \ Qmgr: list sched @serverA
  936. List attributes for default server's scheduler(s):
  937. .br
  938. .B \ \ \ Qmgr: l sched @default
  939. List PBS version for default server's scheduler:
  940. .br
  941. .B \ \ \ Qmgr: l sched @default pbs_version
  942. List queues at a specified server:
  943. .br
  944. .B \ \ \ Qmgr: list queue @server1
  945. .B Listing Resource Definitions
  946. .br
  947. You can use the qmgr
  948. .B list
  949. and
  950. .B print
  951. commands to list resource
  952. definitions showing resource name, type, and flag(s).
  953. To list the name, type, and flag(s) of the named resource(s):
  954. .RS 3
  955. .I list resource <resource name>[,<resource name> ...]
  956. .RE
  957. or
  958. .RS 3
  959. .I print resource <resource name>[,<resource name> ...]
  960. .RE
  961. To list name, type, and flag(s) of custom resources only:
  962. .RS 3
  963. .I list resource
  964. .RE
  965. or
  966. .RS 3
  967. .I print resource
  968. .RE
  969. or
  970. .RS 3
  971. .I print server
  972. (note that this also prints information for the active server)
  973. .RE
  974. To list all custom resources at the specified server, with their
  975. names, types, and flags:
  976. .RS 3
  977. .I list resource @<server name>
  978. .RE
  979. or
  980. .RS 3
  981. .I print resource @<server name>
  982. .RE
  983. When used by a non-privileged user, qmgr prints only resource
  984. definitions for resources that are visible to non-privileged users
  985. (those that do not have the
  986. .B i
  987. flag set).
  988. .B Printing Creation and Configuration Commands
  989. .br
  990. For printing the creation commands for any object except for a
  991. built-in hook.
  992. To print out the commands to create the named object(s) and set their
  993. attributes to their current values:
  994. .RS 3
  995. .I print <object type> <object name>[,<object name> ...]
  996. .br
  997. where object name follows the name rules in "Using Lists of Object Names".
  998. .RE
  999. To print out the commands to create the named object and set its
  1000. attributes to their current values:
  1001. .RS 3
  1002. .I print <object type> <object name> [<attribute name>[, <attribute name>]...]
  1003. .br
  1004. where object name follows the name rules in "Using Lists of Object Names".
  1005. .RE
  1006. To print out the commands to create and configure the active objects
  1007. of the named type:
  1008. .br
  1009. .I \ \ \ print <object type>
  1010. To print out the commands to create and configure all of the objects
  1011. of the specified type at the specified server:
  1012. .br
  1013. .I \ \ \ print <object type> @<server name>
  1014. To print out the commands to create each queue, set the attributes of
  1015. each queue to their current values, and set the attributes of the
  1016. server to their current values:
  1017. .br
  1018. .I \ \ \ print server
  1019. This is used for the server and queues, but not hooks.
  1020. Prints information for the active server. If there is no active
  1021. server, prints information for the default server.
  1022. .B Caveats for Viewing Information
  1023. .br
  1024. Some attributes whose values are unset do not appear in the output of the
  1025. qmgr command.
  1026. Definitions for built-in resources do not appear in the output of the
  1027. qmgr command.
  1028. When a non-privileged user prints resource definitions, qmgr prints
  1029. only resource definitions for resources that are visible to
  1030. non-privileged users (those that do not have the
  1031. .B i
  1032. flag set).
  1033. .SH Saving and Re-creating Server and Queue Information
  1034. To save and recreate server and queue configuration, print the
  1035. configuration information to a file, then read it back in later. For
  1036. example, to save your configuration:
  1037. .br
  1038. .B \ \ \ # qmgr -c "print server" > savedsettings
  1039. .br
  1040. or
  1041. .br
  1042. .B \ \ \ Qmgr: print server > savedsettings
  1043. When re-creating queue and server configuration, read the commands
  1044. back into qmgr. For example:
  1045. .br
  1046. .B \ \ \ qmgr < savedsettings
  1047. .SH Operating on Hooks
  1048. .B Creating Hooks
  1049. .br
  1050. To create a hook:
  1051. .RS 3
  1052. .I Qmgr: create hook <hook name>
  1053. For example:
  1054. .br
  1055. .B Qmgr: create hook my_hook
  1056. .RE
  1057. .B Deleting Hooks
  1058. .br
  1059. To delete a hook:
  1060. .RS 3
  1061. .I Qmgr: delete hook <hook name>
  1062. For example:
  1063. .br
  1064. .B Qmgr: delete hook my_hook
  1065. .RE
  1066. .B Setting and Unsetting Hook Attributes
  1067. .br
  1068. To set a hook attribute:
  1069. .RS 3
  1070. .I Qmgr: set hook <hook name> <attribute> = <value>
  1071. .RE
  1072. To unset a hook attribute:
  1073. .RS 3
  1074. .I Qmgr: unset hook <hook name> <attribute>
  1075. Example: Unset hook1's
  1076. .I alarm
  1077. attribute, causing hook1's alarm to revert to its
  1078. default value of 30 seconds:
  1079. .br
  1080. .B Qmgr: unset hook hook1 alarm
  1081. .RE
  1082. .B Importing Hooks
  1083. .br
  1084. For importing the contents of a hook. Cannot be used with built-in
  1085. hooks.
  1086. To import a hook, you import the contents of a hook script into the
  1087. hook. You must specify a filename that is locally accessible to qmgr
  1088. and the PBS server.
  1089. Format for importing a hook:
  1090. .RS 3
  1091. .I import hook <hook name> application/x-python <content encoding> {<input file> | -}
  1092. .RE
  1093. This uses the contents of
  1094. .I input file
  1095. or stdin (-) as the contents of
  1096. hook
  1097. .I hook name.
  1098. The
  1099. .I input file
  1100. or stdin (-) data must have a format of
  1101. .I content type
  1102. and must be encoded with
  1103. .I content encoding.
  1104. The allowed values for
  1105. .I content encoding
  1106. are "default" (7bit) and
  1107. "base64".
  1108. If the source of input is stdin (-) and
  1109. .I content encoding
  1110. is "default",
  1111. qmgr expects the input data to be terminated by EOF.
  1112. If the source of input is stdin (-) and
  1113. .I content encoding
  1114. is "base64",
  1115. qmgr expects input data to be terminated by a blank line.
  1116. .I input file
  1117. must be locally accessible to both qmgr and the requested
  1118. batch server.
  1119. A relative path
  1120. .I input file
  1121. is relative to the directory where qmgr was
  1122. executed.
  1123. If a hook already has a content script, that is overwritten by this
  1124. import call.
  1125. If the name in
  1126. .I input file
  1127. contains spaces as are used in Windows filenames, input file must be quoted.
  1128. There is no restriction on the size of the hook script.
  1129. .B Examples of Importing Hooks
  1130. .br
  1131. Example: Given a Python script in ASCII text file "hello.py", use its contents
  1132. as the script contents of hook1:
  1133. #cat hello.py
  1134. import pbs
  1135. pbs.event().job.comment="Hello, world"
  1136. .RS 3
  1137. .B # qmgr -c 'import hook hook1 application/x-python default hello.py'
  1138. .RE
  1139. Example: Given a base64-encoded file "hello.py.b64", qmgr unencodes the file's
  1140. contents, and then makes this the script contents of hook1:
  1141. .B \ \ \ # cat hello.py.b64
  1142. .br
  1143. cHJpbnQgImhlbGxvLCB3b3JsZCIK
  1144. .RS 3
  1145. .B # qmgr -c 'import hook hook1 application/x-python base64 hello.py.b64'
  1146. .RE
  1147. Example: To create a provisioning hook called Provision_Hook, and import the
  1148. ASCII hook script called "master_provision.py" located in /root/data/:
  1149. .RS 3
  1150. .B Qmgr: create hook Provision_Hook
  1151. .br
  1152. .B Qmgr: import hook Provision_Hook application/x-python default /root/data/master_provision.py
  1153. .RE
  1154. .B Importing Hook Configuration Files
  1155. .br
  1156. For importing the contents of a hook configuration file. To import a
  1157. hook configuration file, you import the contents of a file to a hook.
  1158. You must specify a filename that is locally accessible to qmgr and the
  1159. PBS server.
  1160. Format for importing a hook configuration file:
  1161. .RS 3
  1162. .I import hook <hook name> application/x-config <content encoding> {<config file>|-}
  1163. .RE
  1164. This uses the contents of
  1165. .I config file
  1166. or stdin (-) as the contents of the configuration file for hook
  1167. .I hook name.
  1168. The
  1169. .I config file
  1170. or stdin (-) data must have a format of
  1171. .I content-type
  1172. and must be encoded with
  1173. .I content encoding.
  1174. The allowed values for
  1175. .I content encoding
  1176. are "default" (7bit) and "base64".
  1177. If the source of input is stdin (-) and
  1178. .I content encoding
  1179. is "default", qmgr expects the input data to be terminated by EOF.
  1180. If the source of input is stdin (-) and
  1181. .I content encoding
  1182. is "base64", qmgr expects input data to be terminated by a blank line.
  1183. .I config file
  1184. must be locally accessible to both qmgr and the requested batch server.
  1185. A relative path
  1186. .I config file
  1187. is relative to the directory where qmgr was executed.
  1188. If a hook already has a configuration file, that file is overwritten
  1189. by this import call.
  1190. If the name in
  1191. .I config file
  1192. contains spaces as are used in Windows filenames, input file must be quoted.
  1193. There is no restriction on the size of the hook configuration file.
  1194. .B Hook Configuration File Format
  1195. .br
  1196. PBS supports several file formats for configuration files. The format
  1197. of the file is specified in its suffix. Formats can be any of the
  1198. following:
  1199. .RS 3
  1200. .ini
  1201. .br
  1202. .json
  1203. .br
  1204. .py (Python)
  1205. .br
  1206. .txt (generic, no special format)
  1207. .br
  1208. .xml
  1209. .RE
  1210. .RS 4
  1211. No suffix: treat the input file as if it is a .txt file
  1212. .br
  1213. The dash (-) symbol: configuration file content is taken from STDIN. The content is treated as if it is a .txt file.
  1214. .RE
  1215. Example: To import a configuration file in .json format:
  1216. .RS 3
  1217. .I # qmgr -c "import hook my_hook application/x-config default my_input_file.json"
  1218. .RE
  1219. .B Exporting Hooks
  1220. .br
  1221. For exporting the contents of a hook. Cannot be used with built-in
  1222. hooks.
  1223. Format for exporting a hook:
  1224. .br
  1225. .RS 3
  1226. .I export hook <hook name> <content type> <content encoding> [<output file>]
  1227. .RE
  1228. This dumps the script contents of hook
  1229. .I hook name
  1230. into
  1231. .I output file,
  1232. or stdout if
  1233. .I output file
  1234. is not specified.
  1235. The resulting
  1236. .I output file
  1237. or stdout data is of
  1238. .I content type
  1239. and
  1240. .I content encoding.
  1241. The only
  1242. .I content type
  1243. currently supported is "application/x-python".
  1244. The allowed values for
  1245. .I content encoding
  1246. are "default" (7bit) and "base64".
  1247. .I output file
  1248. must be a path that can be created by qmgr.
  1249. Any relative path
  1250. .I output file
  1251. is relative to the directory where qmgr was executed.
  1252. If
  1253. .I output file
  1254. already exists it is overwritten. If PBS is unable to
  1255. overwrite the file due to ownership or permission problems, an error
  1256. message is displayed in stderr.
  1257. If the
  1258. .I output file
  1259. name contains spaces like the ones used in Windows
  1260. file names,
  1261. .I output file
  1262. must be enclosed in quotes.
  1263. .B Examples of Exporting Hooks
  1264. .br
  1265. Example: Dump hook1's script contents directly into a file "hello.py.out":
  1266. .RS 3
  1267. .B # qmgr -c 'export hook hook1 application/x-python default hello.py'
  1268. .br
  1269. .B # cat hello.py
  1270. .br
  1271. import pbs
  1272. .br
  1273. pbs.event().job.comment="Hello, world"
  1274. .RE
  1275. Example: To dump the script contents of a hook 'hook1' into a file in "\My
  1276. Hooks\hook1.py":
  1277. .RS 3
  1278. .B Qmgr: export hook hook1 application/x-python default "\My Hooks\hook1.py"
  1279. .RE
  1280. .B Printing Hook Information
  1281. .br
  1282. To print out the commands to create and configure all hooks, including
  1283. their configuration files:
  1284. .br
  1285. .I \ \ \ print hook
  1286. To print out the commands to create and configure the specified hook,
  1287. including its configuration file:
  1288. .br
  1289. .I \ \ \ print hook <hook name>
  1290. .B Saving and Re-creating Hook Information
  1291. .br
  1292. You can save creation and configuration information for all hooks.
  1293. For example:
  1294. .br
  1295. .B \ \ \ # qmgr -c "print hook" > hook.qmgr
  1296. You can re-create all hooks and their configuration files. For example:
  1297. .br
  1298. .B \ \ \ # qmgr < hook.qmgr
  1299. .B Restrictions on Built-in Hooks
  1300. .br
  1301. You cannot do the following with built-in hooks:
  1302. .RS 3
  1303. Import a built-in hook
  1304. .br
  1305. Export a built-in hook
  1306. .br
  1307. Print creation commands for a built-in hook
  1308. .br
  1309. Create a built-in hook
  1310. .br
  1311. Delete a built-in hook
  1312. .br
  1313. Set the type attribute for a built-in hook
  1314. .RE
  1315. .SH Printing Usage Information
  1316. You use the help command or a question mark ("?") to invoke the qmgr
  1317. built-in help function. You can request usage information for any of
  1318. the qmgr commands, and for topics including attributes, operators,
  1319. names, and values.
  1320. To print out usage information for the specified command or topic:
  1321. .br
  1322. .B \ \ \ Qmgr: help [<command or topic>]
  1323. .br
  1324. or
  1325. .br
  1326. .B \ \ \ Qmgr: ? [<command or topic>]
  1327. For example, to print usage information for the set command:
  1328. .RS 3
  1329. .B qmgr
  1330. .br
  1331. .B Qmgr: help set
  1332. .br
  1333. Syntax: set object [name][,name...] attribute[.resource] OP value
  1334. .RE
  1335. .SH Standard Input
  1336. When you start a qmgr session, the qmgr command reads standard input
  1337. for directives until it reaches end-of-file, or it reads the exit or quit
  1338. command.
  1339. .SH Standard Output
  1340. When you start a qmgr session, and standard output is connected to a
  1341. terminal, qmgr writes a command prompt to standard output.
  1342. If you specify the -e option, qmgr echoes the directives it reads from
  1343. standard input to standard output.
  1344. .SH Standard Error
  1345. If you do not specify the -z option, the qmgr command writes a
  1346. diagnostic message to standard error for each error occurrence.
  1347. .SH Exit Status
  1348. .IP 0 5
  1349. Success
  1350. .IP 1 5
  1351. Error in parsing
  1352. .IP 2 5
  1353. Error in execution
  1354. .IP 3 5
  1355. Error connecting to server
  1356. .IP 4 5
  1357. Error making object active
  1358. .IP 5 5
  1359. Memory allocation error
  1360. .SH See Also
  1361. .I The PBS Professional Administrator's Guide,
  1362. and pbs_server_attributes.7B,
  1363. pbs_job_attributes.7B, pbs_hook_attributes.7B, pbs_node_attributes.7B,
  1364. pbs_queue_attributes.7B, pbs_resv_attributes.7B, and pbs_sched_attributes.7B