Data Stage Project File backup (updated)

:: @This batch file creates a backup of the project SSC_DEV4 and zips(rar) and then deletes the unrar file.

:: Precondition : 1)Terminal is mapped to Y drive.

:: 2)DataStage_Project_Backup is mapped to the mapped Y drive.

:: 3)winRaR installed and set on the PATH variable.

:: 4)Datastage server installed on the terminal.

:: Postcondtion : 1)RaR project date stamped file created.

:: Set the following as per the location of this batch file.username and password are for the datastage server.

set BackupDrive=Y

set BackupFolder=DataStage_Project_Backup

set DSProjectName=SSC_DEV4

set ZipPreFix=Z

set username=sriaddala

set password=Addala01


for /f “tokens=1-5 delims=/ ” %%d in (“%date%”) do set fdate= %%e-%%f-%%g

echo “%fdate%”

dscmdexport.exe /H=ssc-epmtst-app /U=”%username%” /P=”%password%” /O=0 “%DSProjectName%” “%BackupDrive%”:\\”%BackupFolder%”\\”%DSProjectName%”_”%fdate%”.dsx


rar a -rr10 -s “%BackupDrive%”:\\”%BackupFolder%”\”%ZipPreFix%””%DSProjectName%”_”%fdate%” “%BackupDrive%”:\\”%BackupFolder%”\\”%DSProjectName%”_”%fdate%”.dsx