# Command¶

## Overview¶

The deadlinecommand application is a command line tool for the Deadline render farm management system. It can be used to control, query, and submit jobs to the farm.

There is also a deadlinecommandbg application which is identical to deadlinecommand, except that it is executed in the background. When using deadlinecommandbg, the output and exit code are written to the Deadline temp folder as dsubmitoutput.txt and dsubmitexitcode.txt respectively. If you want to control where these files get written to, you can use the ‘-outputFiles’ option, followed by the paths to the output and exit code file names. For example:

deadlinecommandbg -outputFiles c:\output.txt c:\exitcode.txt -pools


You can find the deadlinecommand and deadlinecommandbg applications in the Deadline bin folder (Windows or Linux) or the Resources folder (Mac OS X).

## Command Line Options¶

The supported command line options and their usage instructions can be printed out by running ‘deadlinecommand’ from a command prompt or terminal with the ‘-help’ argument.

deadlinecommand -help


To get usage information for a specific command, specify the command name after the -help argument:

deadlinecommand -help SubmitCommandLineJob


## Long Command Lines¶

Some operating systems have a limit on the number of characters that an individual command line can consist of, which can cause problems if you are using deadlinecommand with a large number of command line options. To workaround this issue, you can create a text file with one command line option per line, and pass that file as the only argument to deadlinecommand or deadlinecommandbg. For example, you can create a file called args.txt that looks like this:

-SubmitMultipleJobs
-dependent
-job
\\path\to\job_1_info_file.txt
\\path\to\job_1_plugin_file.txt
-job
\\path\to\job_2_info_file.txt
\\path\to\job_2_plugin_file.txt
-job
\\path\to\job_3_info_file.txt
\\path\to\job_3_plugin_file.txt


You would then pass it to deadlinecommand like this:

deadlinecommand args.txt


## Usage Examples¶

### Submitting a Job¶

To submit a 3dsmax scene (ie. C:\MyScene.max), you must first create a job submission info file (ie. C:\job_info.job) and a 3dsmax plugin info file (ie. C:\max_info.job). See the Manual Job Submission documentation for more information.

Once the files are created, you can submit the job using this command:

deadlinecommand "C:\job_info.job" "C:\max_info.job" "C:\MyScene.max"


### Querying For Jobs Using Filters¶

To query for all jobs that belong to jsmith or cdavis:

deadlinecommand -getjobsfilter username=jsmith username=cdavis


To query for all of jsmith’s jobs with completed status:

deadlinecommand -getjobsfilterand username=jsmith status=completed


### Checking Which Slaves Assigned To A Specific Pool¶

To check which slaves are assigned to the 3dsmax pool:

deadlinecommand -getslavenamesinpool 3dsmax Assigned


To Check which slaves are excluded from the xsi pool:

deadlinecommand -getslavenamesinpool Xsi Excluded


To query for task information for the job with the ID of “546cc87357dbb04344a5c6b5”:

deadlinecommand -getjobtasks 546cc87357dbb04344a5c6b5


### Retrieving and Changing Job Status¶

To retrieve the status of the job with the ID of “546cc87357dbb04344a5c6b5”:

deadlinecommand -getjob 546cc87357dbb04344a5c6b5


To retrieve all of the jobs details:

deadlinecommand -getjobdetails  546cc87357dbb04344a5c6b5


To suspend the job with the ID of “546cc87357dbb04344a5c6b5”:

deadlinecommand -suspendjob 546cc87357dbb04344a5c6b5


To resume the job:

deadlinecommand -resumejob 546cc87357dbb04344a5c6b5


To requeue the job:

deadlinecommand -requeuejob 546cc87357dbb04344a5c6b5


To delete the job:

deadlinecommand -deletejob 546cc87357dbb04344a5c6b5


To archive the job:

deadlinecommand -archivejob 546cc87357dbb04344a5c6b5


### Sending An Email¶

To send the message to jsmith@mycompany.com(cc cjones@mycompany.com):

deadlinecommand -sendemail -to jsmith@mycompany.com -cc cjones@mycompany.com
-subject "the subject" -message "C:\MyMessage.html"


To send the same message with the attachment “C:\MyAttachment.txt”:

deadlinecommand -sendemail -to jsmith@mycompany.com -cc cjones@mycompany.com
-subject "the subject" -message "C:\MyMessage.html" -attach "C:\MyAttachment.txt"


Note that the -to, -subject, and -message options are required. The other two options are optional.