Generate scripts for the data sync operation.
Procedure
-
Download the Sample XML File and save the file with restore_by_job.xml name on the CommServe.
-
Open the restore_by_job.xml file using an XML editor and provide a value for the following parameters:
-
clientName - Name of the source computer
-
destClient - Name of the destination computer
-
destPath - Path for restoring the files
-
mapFilePath - Path of the map file
Note: This XML file will be used as an input file for the batch file which picks up the last successful backup job and triggers a restore by job operation for that job.
-
-
Add the following content to a file and save the file as restore_last_backup.bat on the CommServe. Make sure that the file is saved as a batch file (.bat extension).
@echo off setlocal ENABLEDELAYEDEXPANSION if not defined GALAXY_BASE set GALAXY_BASE=$[SoftwareInstallationDirectoryBase] set PATH=$[%PATH%;%GALAXY_BASE%] set response="$[RBJ_13328124.tmp]" set BackupJobID =$[0] qlogin -u "$[Username]" -ps "$[Password]" -cs "$[CommServeName]" if %errorlevel% NEQ 0 ( echo Login failed. goto endOfScript ) :The following command fetches the last successful backup job id. FOR /F "skip=$[2]" %%J IN ('qlist lastjob -c $[Source_computer] -a $[Q_FILESYSTEM] -b "$[defaultBackupSet]" -s "$[SubClientName]" -js $[Completed]') do ( set BackupJobID= %%J ) :The following command triggers the restore by job using Command Line. qoperation execute -cs $[CommServeName] -af $[Path_of_the_xml_file] -jobids $[%BackupJobID%] -sourceItem "$[2:%BackupJobID%]" qlogout
-
Provide the following input values in the saved batch file:
-
SoftwareInstallationDirectory - Software installation directory
-
Username, Password - User details saved in the Record the Username and Password procedure.
-
CommServeName - Name of the CommServe
-
Source_computer - Name of the source computer
-
SubClientName - Name of the subclient
-
Path_of_the_xml_file - Path of the restore_by_job.xml file.
-