Cisco Tidal Enterprise Scheduler 6.2.1 Command Line .

Transcription

Cisco Tidal Enterprise Scheduler 6.2.1 SP3Command Line Program GuideFebruary 5, 2016Americas HeadquartersCisco Systems, Inc.170 West Tasman DriveSan Jose, CA 95134-1706USAhttp://www.cisco.comTel: 408 526-4000800 553-NETS (6387)Fax: 408 527-0883

THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS,INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS.THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITHTHE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY,CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY.The Cisco implementation of TCP header compression is an adaptation of a program developed by the University of California, Berkeley (UCB) as part of UCB’s public domain versionof the UNIX operating system. All rights reserved. Copyright 1981, Regents of the University of California.NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED “AS IS” WITH ALL FAULTS.CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THOSE OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE.IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUTLIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERSHAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL:www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationshipbetween Cisco and any other company. (1110R)Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output,network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative contentis unintentional and coincidental.Cisco Tidal Enterprise Scheduler 6.2.1 SP3 Command Line Program Guide 2016 Cisco Systems, Inc. All rights reserved.

CONTENTSPrefaceixAudienceixRelated DocumentationixObtaining Documentation and Submitting a Service RequestDocument Change HistoryIntroduction1-11Overview1-11xInstalling the Command Line ProgramWindows 1-11Linux/Unix 1-121-11Activating the Command Line ProgramUsing Job Aliasesix1-121-13Scripts and Batch Files1-13Running the Command Line from TES1-13Command Modes 1-13Single Command Mode 1-14Multiple Command Mode 1-14Command Line Interface 1-15Command Line Syntax 1-15Text Conventions 1-16Job Status ID Cross Reference1-16Command Summary 1-17Master Commands 1-18Individual Job Occurrence Commands 1-18Production Schedule Commands 1-19Dependency Commands 1-19Job and Job Group Definitions Commands 1-19Batch Processing Command 1-20Help Command 1-20Command Descriptionsaddrule2-232-23Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guide6.2.1iii

ContentsSyntax 2-24addrule -optionsExamples 2-25agent2-242-26Syntax 2-26agent -options 2-26Examples 2-26alerts2-27Syntax 2-27alert[s] -options 2-27Examples 2-27alertset2-28Syntax 2-28alertset -optionsOperation 2-28Examples 2-28calendar2-28Syntaxcalrecalc2-292-29Syntax 2-29calrecalc -optionsOperation 2-29compile2-292-29Syntax 2-29compile -optionsOperation 2-30Examples 2-30delrule2-282-302-30Syntax 2-30delrule -options 2-31Operation 2-31Examples 2-31depadd2-31Syntax 2-31depadd -options 2-32Job Dependency Options 2-32File Dependency Options 2-33Variable Dependency Options 2-34Examples 2-34Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guideiv6.2.1

Contentsdepdel2-34Syntax 2-34depdel -options 2-35Examples 2-36file2-37Syntax 2-37Operation 2-37Example 2-37grpupd2-38Syntax 2-38grpupd -optionshelp2-382-38Syntax 2-38help -options 2-38Operation 2-38Example 2-39historyPurge 2-39Syntax 2-39historyPurge -optionsOperation 2-40Example 2-40hosts2-40Syntax 2-40hosts -optionsinactrule2-402-40Syntax 2-40inactrule -optionsExamples 2-41jobadd2-392-412-41Syntax 2-41jobadd -options 2-42Examples 2-42jobcancel 2-42Syntax 2-42jobcancel -optionsOperation 2-43Examples 2-43jobdep2-432-43Syntax2-43Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guide6.2.1v

Contentsjobdep -options 2-44Examples 2-44jobgo2-44Syntax 2-44jobgo -options 2-44Operation 2-44jobhold2-45Syntax 2-45jobhold -options 2-45Operation 2-45jobmod2-45Syntax 2-45jobmod -optionsjobmon2-452-46Syntax 2-47jobmon -optionsExamples 2-482-47jobrelease 2-48Syntax 2-48jobrelease -optionsOperation 2-49Example 2-492-49jobremove 2-49Syntax 2-49jobremove -optionsOperation 2-50Examples 2-502-49jobrerun2-50Syntax 2-50jobrerun -optionsOperation 2-51Example 2-51jobset2-502-51Syntax 2-51jobset -options 2-52Operation 2-52Examples 2-52listrule2-52Syntax2-52Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guidevi6.2.1

Contentslistrule -options 2-53Examples 2-54liststat2-54Syntax 2-54liststat -optionsmodrule2-55Syntax 2-55modrule -optionsOperation 2-61Examples 2-61output2-552-552-62Syntax 2-62output -options 2-62Operation 2-62pause2-62Syntax 2-62pause -optionsqlimit2-622-62Syntax 2-62qlimit -options 2-63Operation 2-63resume2-63Syntax 2-63resume -optionsstatus2-632-63Syntax 2-64status -options 2-64Examples 2-64submit2-65Syntax 2-65submit -options 2-65Examples 2-65useradd2-65Syntax 2-65useradd -optionsOperation 2-66varset2-662-66Syntax 2-66varset -options2-66Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guide6.2.1vii

ContentsOperation2-67Using the Master Command Line UtilityOverview3-71Options for the TESM Command 3-71cm 3-72FT 3-72JMX 3-72keystoremgr 3-73loglevel 3-73pause 3-73resume 3-74setpwd 3-74superuseradd userid domainnamesystemvalue 3-75Customizing the Command Line 714-24-3Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guideviii6.2.1

PrefaceThis guide describes how to the Command Line Program for Cisco Tidal Enterprise Scheduler (TES) 6.2.AudienceThis guide is for administrators who want to use the Command Line program to automate TES jobcontrol functions.Related DocumentationSee the Cisco Tidal Enterprise Scheduler 6.2 Documentation Overview for a list of all TES guides.NoteWe sometimes update the documentation after original publication. Therefore, you should also reviewthe documentation on Cisco.com for any updates.Obtaining Documentation and Submitting a Service RequestFor information on obtaining documentation, submitting a service request, and gathering additionalinformation, see What’s New in Cisco Product Documentation w/whatsnew.html.Subscribe to What’s New in Cisco Product Documentation, which lists all new and revised Ciscotechnical documentation, as an RSS feed and deliver content directly to your desktop using a readerapplication. The RSS feeds are a free service.Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guide6.2.1ix

PrefacePrefaceDocument Change HistoryThe table below provides the revision history for the Command Line Program Guide.Version Number Issue DateReason for Change6.2May 2014 Updates for 6.2 release.6.2.1 (SP3)February 2016 Added ‐r TES variable , a new alternative option for the varsetcommand. This option indicates that the value for the variable iscontained in another TES variable which has to be resolved first. Minor corrections and restructuring.Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guidex6.2.1

CH A P T E R1IntroductionOverviewA hidden aspect of TES is its command line program. The sacmd.cmd (Windows) or sacmd.sh(Unix/Linux) program provides access to TES through the MS-DOS command prompt. The Unix versionof TES uses a similar program called tesmcmd. The command line program is generally done from theTidal Web client but you can also use the sacmd.cmd (Windows) or sacmd.sh (Unix/Linux) program ona master machine. You can automate TES job control functions by including commands in scripts or byembedding job control functions in the code running your company processes.This chapter covers these topics: Installing the Command Line Program Activating the Command Line Program Using Job Aliases Scripts and Batch Files Running the Command Line from TES Command Modes Command Line Interface Command SummaryInstalling the Command Line ProgramWindowsTo install the Command Line program for Windows:Step 1From your Enterpise Scheduler product DVD, locate and run Command Line\TIDAL Enterprise SchedulerCommandLine.msi for either 32-bit or 64-bit.Step 2Click Next.The Destination Folder panel displays.Step 3Click Next to install to the default folder location or click Change to choose a different location.Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guide6.2.11-11

Chapter 1IntroductionActivating the Command Line ProgramThe Ready to Install the Program panel displays.Step 4Click Install to begin the installation.When the setup is complete, the Setup Completed panel displays.Step 5Click Finish to complete the installation.Linux/UnixTo install the Command Line program from Console mode:Step 1Open a command prompt window by selecting from the Start menu, Programs Command Prompt.Step 2Enter ./install.bin -i console.Step 3Press ENTER to continue the installation.The Choose Install Folder screen displays.Step 4Press ENTER to select the default location.-orEnter an absolute path to the appropriate location, then press ENTER.Step 5At the IS THIS CORRECT? prompt, enter Y if the path for the install folder is correct or N if it isincorrect.Step 6Press ENTER.The Pre-Installation Summary screen displays.Step 7After reviewing the installation information, press ENTER to begin the installation.The Installing screen displays.Step 8When the installation is complete, press ENTER to exit the installer.Activating the Command Line ProgramBefore you can use the Command Line Program, you must connect to the Client Manager DSP.To connect:Step 1Verify that the Master and Client Manager are running.Step 2Locate the path to the sacmd command and enter the following information:sacmd -cmdspurl http://hostname:8080/api/tes-6.2 -user username -pass passwordCisco Tidal Enterprise Scheduler 6.2 Command Line Program Guide1-126.2.1

Chapter 1IntroductionUsing Job AliasesUsing Job AliasesThe command-line interface to TES allows you to refer to jobs by their job ID number or the job alias.Job aliases are set automatically to the unique job ID number whenever you create a job definition. Youcan edit the job alias to a name of your own choosing on the Options tab in the Job Definition dialog;however, the job alias must be unique and the Job Alias field cannot be left blank. Many commandsallow you to refer to a job or group using the alias name or job ID, but not the full job or group name.Job aliases must be between one and eight characters in length. Do not use spaces in job aliases.NoteYou can use the listrule command to discover the job alias, as well as other job rule data, for your jobsand job groups.Scripts and Batch FilesThe sacmd.cmd (Windows) or sacmd.sh (Unix/Linux) program includes the file command that readscommands from a file, letting you batch-process a group of commands.You can add comments to your file by preceding the comment with two forward slashes (//) or the sharp sign (#). You can use spaces or tabs in front of the comment character (// or #), but otherwise it must be the first character in a line.Lines that contain only spaces or tabs are ignored. You can add clarity to your script or batch file byusing blank lines to separate different sections of your file.Running the Command Line from TESThe Command file can be defined in a job definition along with any necessary command parameters.Commands can be run from TES as jobs if the user: is a valid Scheduler user. (A valid Scheduler user can login to the Tidal Web client. A user who isonly a runtime user is not a valid Scheduler user.) either uses Windows passwords-orruns the agent as a user has the TES access right to a particular commandCommand files are defined from the Program tab of the Job Definition dialog. The command isentered in the Command field and any parameters for the command are entered in the Parametersfield.Information for accessing the DSP should precede the command line command in the CommandParameters field.Command ModesThere are two modes for entering commands from the command line program, Single and MultipleCommand.Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guide6.2.11-13

Chapter 1IntroductionCommand ModesNoteBefore using sacmd command , you can set -persist to save the given URL, user and password in anencrypted file in the user's home directory, so that next time sacmd is started, the URL, user andpassword will not have to be specified. For further information on command arguments, refer to the helpby running sacmd -help from the bin directory of the Command Line Program home.Single Command ModeUsing this mode, type SACmd before each command. After entering the command, you return to theMS-DOS prompt.To enter a single command:Step 1Open a command prompt window by selecting Start Programs Accessories Command Prompt.Step 2Change directories by entering the following text (if you used the default location for files duringinstallation) after the prompt:cd /d C:\Program Files\TIDAL\TESCmdLine\binPress the ENTER key and your prompt becomes the following:C:\Program Files\TIDAL\TESCmdLine\bin Step 3Enter SACmd and then the command and press the ENTER key. The command executes and you arereturned to the prompt.C:\Program Files\TIDAL\TESCmdLine\bin For example,C:\Program Files\TIDAL\TESCmdLine\bin\ SACmd status -i 8Multiple Command ModeUsing the multiple command mode, you can enter TES commands without typing SACmd each time.To enter multiple command mode:Step 1Open a command prompt window by selecting Start Programs Accessories Command Prompt.Step 2Change directories by entering the following (if you used the default location for files duringinstallation) after the C:\ prompt:cd /d C:\Program Files\TIDAL\TESCmdLine\binPress the Enter key and your prompt becomes the following:C:\Program Files\TIDAL\TESCmdLine\bin Step 3Type SACmd and press the ENTER key again.The prompt changes to SACmd and remains SACmd until you exit. You are now in program’s multiplecommand mode. You can enter TES commands without preceding them with SACmd. For example,entering a command from this mode looks like this:SACmd status -i 8Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guide1-146.2.1

Chapter 1IntroductionCommand Line InterfaceTo exit, enter EXIT and press the ENTER key.Command Line InterfaceNoteVerify the Master and Client Manager are up and running before using the Command Line program.NoteBefore using sacmd command , you can set -persist to save the given URL, user and password in anencrypted file in the user's home directory, so that next time saCmd is started, the URL, user andpassword will not have to be specified. For further information on on command arguments, refer to thehelp by running sacmd -help from the bin directory of the Command Line Program home.NoteOnce you have entered a SACmd session, you can enter help for an understanding of availablecommands. For example, SACmd help.To start the TES command line interface, enter SACmd at an MSDOS command prompt.The general format for using SACmd is as follows:SACmd command -option1 Argument1 -option2 “Argument 2”where you provide the command, the options and the arguments. For example:SACmd addrule -n alfa -Gwhere addrule is the command, n and G are options, alfa is the argument for n, and G has noargument.Command Line SyntaxCommand syntax is listed for each command. Any argument not enclosed in brackets is required. When options are enclosed in square brackets, that is, [and], they are optional and not required. If options are separated with a vertical bar, that is, , either one or the other option must be used.The argument for an option may be required or optional, depending on the command. If you do use anargument, it must follow the option it belongs to.Options and arguments are case sensitive, but the command is not. If an argument has a space, enclosethe argument in quotes. For example,SACmd addrule -G -a clock -h “Windows Agent”In the above example, “Windows Agent” is the argument to the -h option. Windows Agent wasenclosed in quotes because it contains a space.The order of the arguments is usually not important. If arguments do need to be given in a specific order,it is stated in the text.Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guide6.2.11-15

Chapter 1IntroductionCommand Line InterfaceWarningAlways enclose arguments containing spaces in quotes, or the command will not executesuccessfully. For example, if the Program Files folder is included in a path statement as an argument,the entire path must be enclosed by quotes.Text ConventionsEach listed command may have several sections to explain different aspects of the command. Syntax – Displays how to enter the command. The syntax section uses certain punctuationconventions to denote characteristics of the command options as explained in the prior “CommandLine Syntax” section. Options – Explains each parameter for the command. Operation – Amplifies aspects of command behavior that may not be readily apparent. Examples – Displays some ways to use the command.Job Status ID Cross ReferenceUsually, when specifying job status in a command, you either specify the job status itself, or you specifyits job status ID. For example:SACmd jobset -i 3245 -s “Completed Abnormally”CautionWhen specifying the job status, any status containing two or more words must be in quotes. Allarguments including spaces must be enclosed in quotes, or your command will not execute successfully.It may be easier to specify a job status using a numerical value when you know the status that thenumerical value corresponds to. For example, the above command can be typed as:SACmd jobset -i 3245 -s 103The following table cross-references each job status as shown in the Tidal Web client with their internaljob status number. You can also obtain this information using the liststat command.Table 1-1Job StatusJob StatusJob Status IDScheduled0Waiting on Dependencies1Waiting on Operator2Held3Timed Out for Day5Agent Unavailable7Agent Disabled8Agent Outage9Waiting on Group10Cisco Tidal Enterprise Scheduler 6.2 Command Line Program Guide1-166.2.1

Chapter 1IntroductionCommand SummaryTable 1-1Job StatusJob StatusJob Status IDWaiting on Children11Cancel Pending12Waiting on or Occurred66Completed Normally (Gathering Output)97Completed Abnormally (Gathering Output)98Externally Defined (Gathering Output)99Completed100Completed Normally101Completed ally Defined107Timed Out108Cancelled109Preorphan110Cancelled Normally112Command SummaryThe tables in the following sections list all available commands and their descriptions: Master Commands Individual Job Occurrence Commands Production Schedule Commands Dependency Commands Job and Job Group Definitions Commands Batch Processing Command Help CommandCisco

Step 1 From your Enterpise Scheduler product DVD, locate and run Command Line\TIDAL Enterprise Scheduler CommandLine.msi for either 32-bit or 64-bit. Step 2 Click Next. The Destination Folder panel displays. Step 3 Click Next to install to