Loading...

Command Line Operations

You can perform job configurations through the command line.

Viewing Job Summary (qlist jobsummary)

Description

This command lists the current state of all active jobs in the CommServe. Jobs are classified into the following states:

  • Running
  • Suspended
  • Pending
  • Queued
  • Waiting

You can also filter the jobs by client, agent, instance, backup set or subclient.

In case of an error, an error code and description are displayed as: "media: Error errorcode: errordescription"

Usage

qlist jobsummary [-c <client>] [-a <iDataAgent>] [-i <instance>] [-b <backupset>] [-s <subclient>] [-tf <tokenfile>] [-tk <token>] [-h]

Options

-c

Client computer name

-a

Agent type installed on client computer (see Argument Values - Agent Types)

-i

Instance name, required for certain agents

-b

Backup set name, required for certain agents

-s

Name of the subclient

-tf

Reads token from a file

-tk

Token string

-h

Displays help

Diagnostics

Possible exit status values are:

0 - Successful completion.

1 - CLI usage failures, due to the use of an unsupported option or missing argument.

2 - Any other failure. 

Example

Display job summary of all jobs of client cl1.

qlist jobsummary -c cl1
RUNNING PENDING WAITING QUEUED SUSPENDED TOTAL
 1       10      0       4      1         16

Setting Job Control (qoperation jobcontrol)

This command allows you to kill, resume, suspend, or change/set the progress (in percentage) of a given job. To operate on a single job, specify the Job ID. To operate on more than one job in a specific area, specify the client or MediaAgent name. You can also specify additional levels such as the agent, instance, backup set and/or subclient. The -all option can be used to suspend/resume all jobs.

If the operation is successful, no message is displayed on the command prompt. In case of an error, an error code and description are displayed as: "jobcontrol: Error errorcode: errordescription".

Usage

qoperation jobcontrol [-o <joboperation>] [-j <jobid>] - all [-m MediaAgent] [-c <client>] [-a <dataagenttype>] [-i <instance>] [-b <backupset>] [-s <subclient>] [-p <priority>] [-tfx <total files to transfer>] [-fx <files transferred>] [-ifx <files transferred since last update>] [-tbx <total bytes to transfer>][-tf <tokenfile>] [-tk <token>] [-h]

Options

-o

Operation to be performed on the job. Valid values are:

  • kill
  • suspend
  • resume
  • changepriority

-j

Job ID

-all

All jobs

-m

MediaAgent name

-c

Client computer name

-a

iDataAgent type installed on client computer (see Argument Values - Agent Types)

-i

Instance name

-b

Backup set name

-s

Subclient name

-p

Job priority

-tfx

Total files to transfer

-fx

Files transferred

-ifx

Files transferred since last update

-tbx

Total bytes to transfer

-tf

Reads token from a file

-tk

Token string

-h

Displays help

Diagnostics

Possible exit status values are:

0 - Successful completion.

1 - CLI usage failures, due to the use of an unsupported option or missing argument.

2 - Any other failure.

Example

  • Kill a job with job ID 175.

    qoperation jobcontrol -j 175 -o kill

  • Suspend all jobs under MediaAgent ma1.

    qoperation jobcontrol -m ma1 -o suspend

  • Suspend all jobs.

    qoperation jobcontrol -all -o suspend

  • Resume all jobs under client cl1 and dataagent "Q_WIN2K_FS".

    qoperation jobcontrol -c cl1 -a Q_WIN2K_FS -o resume

  • Change priority of a job with job ID 175 to 100.

    qoperation jobcontrol -j 175 -p 100 -o changepriority

Setting Job Retention (qoperation jobretention)

This command allows you set retention rules on a given job. The job ID, storage policy, and storage policy copy names must be specified when using this command.

Jobs that are not retained are subject for data aging. Jobs that are retained with a specified retention period will become subject for data aging after the retention period ends. If you retain a job, however, and do not specify the retention period, the job data will never be subject for data aging.

In case of an error, an error code and description are displayed as: "jobretention: Error errorcode: errordescription".

Usage

qoperation jobretention -j <jobid> -sp <storagepolicy> -spc <copy> -rtn <true|false> [-rd <infinite or mm/dd/yyyy hh:mm:ss or yyyy/mm/dd hh:mm:ss>]

Options

-j

Job ID

-sp

Storage policy name

-spc

Storage policy copy name

-rtn

Job to be retained (true) or not (false)

-rd

Date until the job is to be retained. Valid values are:

  • infinite
  • mm/dd/yyyy hh:mm:ss
  • yyyy/mm/dd hh:mm:ss

-tf

Reads token from a file

-tk

Token string

-h

Displays help

Diagnostics

Possible exit status values are:

0 - Successful completion.

1 - CLI usage failures, due to the use of an unsupported option or missing argument.

2 - Any other failure.

Example

Retain a job - with job ID 175, storage policy sp1 and storage policy copy copy1 - indefinitely by setting the retention period to infinite.

qoperation jobretention -j 175 -rtn true - rd infinite -sp sp1 -spc copy1

Viewing the Last Backup Job (qlist lastjob)

This command displays the summary details of all previous backup jobs completed by a specific client, instance, backup set or subclient. Whenever more than one job is found, the name of each backup job is listed in its own line. The message, "No job found," is displayed on the command prompt whenever backup jobs are not found.

In case of an error, an error code and description are displayed as: "lastjob: Error errorcode: errordescription".

Usage

qlist lastjob -c <client> -a <iDataAgent> -i <instance> -b <backupset> -s <subclient> [-js <jobstatus>] [-tf <tokenfile>] [-tk <token>] [-h]

Options

-c

Client computer name

-a

Agent type installed on client computer (see Argument Values - Agent Types)

-i

Instance name, required for certain agents

-b

Backup set name, required for certain agents

-s

Name of the subclient

-js

The completion status of the job. Use this option to see the last backup job that completed with a particular status. Valid values for this option are:

  • Completed
  • Failed
  • Killed

-tf

Reads token from a file

-tk

Token string

-h

Displays help

Diagnostics

Possible exit status values are:

0 - Successful completion.

1 - CLI usage failures, due to the use of an unsupported option or missing argument.

2 - Any other failure. 

Example

Display the last backup job that ran under client client01.

qlist lastjob -c client01

JOBID STATUS    STORAGE POLICY APPTYPE    BACKUPSET SUBCLIENT INSTANCE  START TIME
----- ------    -------------- -------    --------- --------- --------  ----------
101   Completed SP_12          Filesystem set001    Sub01     <default> 01/01/2013 01:20:55

Viewing a List of Backed Up Files

Use the following steps to generate a list of files which are backed up during a specific job.

  1. Open the Command Prompt and go to software_installation_directory/Base and run the following command:

    qlogin -cs <commserve_host_name> -u <user name>

  2. Execute the following command from the software_installation_directory/Base folder after substituting the parameters:

    ListFilesForJob.exe -job <JOBID> -ma <MAName> [-vm <Instance>] [-flag <ArchiveBitFlag>] [-tmpdir <TMPDIRPATH>] [-o <OUTFILENAME>]

  3. Go to the path specified in TMPDIRPATH and open the OUTFILENAME file to view the list of files.

The following table displays the parameters that need to be provided before running the command:

Parameter

Description of Parameter Values

JobID

The job id of the job for which you are generating the list.

MAName

Name of the MediaAgent which is used to perform the backup job.

Instance

Name of the instance which you have used to install the Windows File System iDataAgent.

This is an optional argument. If you do not specify any value, the job in Instance001 will be used by default to generate the list of files.

ArchiveBitFlag

1 to set the Archive Bit.

0 to reset the Archive Bit.

This is an optional argument. If you do not specify any value, the archive bit will not change and the file that contains the list of files can not be deleted.

TMPDIRPATH

The directory in which you want to create the file.

This argument is optional. If you do not specify any directory, the file will be created in the default temporary directory.

The default temporary directory for the software is set using the dGALAXYTEMPDIR registry key. When you install Windows File System iDataAgent, the dGALAXYTEMPDIR registry key gets created at the following location: HKEY_LOCAL_MACHINE\SOFTWARE\CommVault Systems\Galaxy\Instance<xxx>\Base

OUTFILENAME

The name of the file in which you want to store the list.

Updating Jobs

Use the following steps to suspend, kill, or resume one or more jobs or to update the reason for suspending, killing, or resuming the jobs.

  1. Download the update_job_template.xml file to the computer where you will run the command.
  2. Open the .xml file and update the XML parameters listed in the table below.
  3. Run the qlogin command to log on to the CommServe computer.
  4. From software_installation_directory/Base type the following command after substituting the XML parameters:

    qoperation execute -af update_job_template.xml

  5. Optional: Verify the jobs were updated by viewing the jobs in the CommCell Console Job Controller window.

The following table displays the XML parameters needed before running the qoperation command:

Parameter

Description of Parameter Values

message

The jobs that will be updated.

Valid values are:

  • ALL_JOBS, the operation in the operationType parameter will affect all jobs
  • ALL_SELECTED_JOBS, the operation in the operationType parameter will affect the jobs defined in the jobId parameter

operationDescription

The reason for suspending, killing, or resuming the job.

operationType

The operation to perform on the job.

Valid values are:

  • JOB_SUSPEND
  • JOB_RESUME
  • JOB_KILL

jobId

The job IDs for the jobs that will be suspended, killed, or resumed. Use the jobId parameter when the message parameter is set to ALL_SELECTED_JOBS. To add more than one job, add the following line for each job:

<jobs jobId="job_ID" />

Last modified: 11/20/2019 5:05:10 PM