qoperation execscript

Description

Use this command to execute the QScripts available on the CommServe computer, either from the CommServe computer or from a client computer. The script name and the parameters for executing the script are provided as inputs to the command. In addition, you can provide the file name to which the output will be redirected, and the format in which the output will be displayed. The output can be obtained in multiple formats. By default, the output is displayed in .XLS format. Refer to QScripts to view the list of available qscripts.

If there is a failure when creating the output file, the output is displayed on the command prompt after the script is executed. Also, if you do not provide a file name, the output is displayed on the command prompt.

QScripts are recommended for advanced users only. QScripts can be directly executed using qoperation execscript qcommand. Therefore caution is recommended while using them since the operations performed using the QScripts do not have the same safety protocols that are available with other options from the CommCell Console.

Permission

Executing QScripts requires the Administrative Management permission at the CommCell level unless otherwise stated in the readme file for the qscript.

Usage

qoperation execscript [-cs <commserve_host_name>] -sn <scriptname> [-c <client>] [-si <scriptparam>] [-p1 <password>] [-p2 <password>] [-p3 <password>] [-file <outFile>] [-format <outputFormat>] [-help] [-tf <tokenfile>] [-tk <token>] [-h]

Note

When you run the command from a Linux platform, apply single quotes for any non-numeric values and then use double quotes. For example, "'StoragePolicy1'".

Options

-p1

Password to be encrypted using V1 Encryption

-p2

Password to be encrypted using V2 Encryption

-p3

Password to be encrypted using V3 Encryption

-file

File where the output is to be written

-format

Output format, which can be:

  • xml

  • xls - separates the values by tabs.

  • csv - displays the output in a comma separated value format.

  • max - hides the header names in the output.

  • unicode - displays the output in unicode characters.

  • maxunicode - displays the output in unicode characters and hides the header names.

-help

Displays help on SQL script

-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.

Examples

  • The following command uses the qscript GetSubclients to retrieve the subclient usage information on client1:

    qoperation execscript -sn GetSubclients.sql -si client1
  • The following command can be used to configure all SQL Clients to delete the databases from subclient content when the database is physically removed from SQL server:

    qoperation execscript -sn SetKeyIntoGlobalParamTbl.sql -si IgnoreNonExistentDB -si y -si 1
  • The following command can be used to trigger an event to run a full backup before a transaction log backup. This reduces the chance of data loss if any transaction log backup becomes corrupted.

    qoperation execscript -sn SetKeyIntoGlobalParamTbl.sql -si SQLiDALogThreshHoldCount -si y -si <number>

  • When you give date and time values as inputs in a PowerShell command on a Windows computer, you must put the whole parameter in double quotes. For example, the following command returns data protection (backup, snap and archive) jobs ended in the past 7 days time.

    qoperation execscript -sn QS_DataProtectionJobSummary -si "@LastNDays='7'"

Loading...