Command Line Interface - Backup - Windows File System iDataAgent
In order to run the backups from command line, you need an input xml file which contains the parameter values for configuring the backup options. This input xml file can be obtained from one of the following ways:
- Download the input xml file template and save it on the computer from where the backup will be performed.
- Generate the input xml file from the CommCell Console and save it on the computer from where the backup will be performed.
Use the following steps to perform the backup:
- Download the backup_template.xml file and save it on the computer from where the command will be executed.
- From Command prompt, navigate to <Software_Installation_Directory>/Base and run the following command:
qlogin -cs <commserve name> -u <user name>
- Execute the saved .xml script using qoperation execute command.
qoperation execute -af backup_template.xml -appName 'File System' -clientName xxxxx -backupsetName xxxxx -subclientName xxxxx -backupLevel FULL
- Verify the status of the job using the following command:
qlist job –j JOBID
- Once the job completes, logout from the CommServe using the qlogout command.
qlogout [-cs <commserve_host_name>] [-all] [-tf <tokenfile>] [-tk <token>] [-h]
|Performing a Full Backup||
qoperation execute -af backup_template.xml -appName 'File System' -clientName client1 -backupsetName backupset1 -subclientName subclient1 -backupLevel FULL
|Performing an Incremental Backup||
qoperation execute -af backup_template.xml -appName 'File System' -clientName client1 -backupsetName backupset1 -subclientName subclient1 -backupLevel INCREMENTAL
|Performing a Synthetic Full Backup|| When you run a Synthetic Full backup, an incremental backup is automatically ran first to ensure that new data since the last backup is included in the synthetic full.
qoperation execute -af backup_template.xml -appName 'File System' -clientName client1 -backupsetName backupset1 -subclientName subclient1 -backupLevel SYNTHETIC_FULL
Use the following steps to generate a list of files which are backed up during a specific job.
- Open the Command Prompt and navigate to <Software_Installation_Directory>/Base and run the following command:
qlogin -cs <commserve_host_name> -u <user name>
- Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters:
ListFilesForJob.exe -job <JOBID> -ma <MAName> [-vm <Instance>] [-tmpdir <TMPDIRPATH>] [-o <OUTFILENAME>]
- Navigate to the directory specified in TMPDIRPATH and open the
file specified in OUTFILENAME 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.
|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.|
In addition to the parameter values provided in the template xml file, if you want to include additional options for the backup, you can do so by selecting the required options from the CommCell Console and generate the command line xml script for the backup.
Follow the steps given below to generate a script which you can use to perform a backup from the command line interface:
- From the CommCell Console, navigate to <Client> | File System | defaultBackupSet.
- Right click the default subclient and click Backup.
- Select the required backup options which you want to execute using the script.
- Click Save as Script.
- Enter the location to save the script along with the file name and extension. For example, "C:\scripts\myscript.bat" on Windows and "/usr/scripts/myscript.sh" on Unix. Alternatively, you can also click Browse and navigate to the location.
The script will be saved as a .xml file and .bat/.sh file.
If a file with the same name already exists in the specified location, both the .xml and .bat/.sh files will be overwritten.
- Enter the username and password for the user account which you want to use to perform the backup.
By default, the user account which you have used to login to CommCell console is used for performing the backup. However, if the user account does not have access to any application or database, click Use a different account.
- Click OK.