Advertisements

SIEBEL: Personal srcctrl.bat for local Repository backup. No need of Server Configuration.

Version 1.2: Modified code with  delete command, to clean the Siebel Temp folder. This was a bug in earlier version 1.0 and 1.1 after doing the Undo Checkout in Siebel Tool.

color 72

set UNPADDEDHOURWITHSPACE=%TIME:~0,2%

set /a UNPADDEDHOUR=%UNPADDEDHOURWITHSPACE%

set EXTRAZERO=0%UNPADDEDHOUR%

set HOUR=%EXTRAZERO:~-2%

set curdate=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%

set curtime=%HOUR%-%TIME:~3,2%

@echo on

IF EXIST C:\Siebel\8.1\Tools_1\Backups goto srcctrl

mkdir C:\Siebel\8.1\Tools_1\Backups

:srcctrl

set logfile= C:\Siebel\8.1\Tools_1\Backups\logfile.log

echo "Setting a path for log srcctrl bat log file.">> %logfile%

echo "Setting a path for Projects Sif.">> %logfile%

set projfolder=C:\Siebel\8.1\Tools_1\Backups\Projects\%curdate%\%curtime%\Projects >> %logfile%

set projdatename=C:\Siebel\8.1\Tools_1\Backups\Projects\%curdate%\%curtime%\Projects >> %logfile%

echo "Setting a path for Objects Sif.">> %logfile%

set objfolder= C:\Siebel\8.1\Tools_1\Backups\Objects\%curdate%\%curtime%\Objects >> %logfile%

set objdatename= C:\Siebel\8.1\Tools_1\Backups\Objects\%curdate%\%curtime%\Objects >> %logfile%

echo "Creating directory for Objects and Projects Sif" >> %logfile%

mkdir %projdatename% >> %logfile%

mkdir %objdatename% >> %logfile%

echo============Started srcctrl.bat file on %DATE% %TIME%=========>>%logfile%

Echo "Process of SIF Backup is started." >> %logfile%

copy C:\Siebel\8.1\Tools_1\TEMP\Projects\*.* %projfolder% >>%logfile%

copy C:\Siebel\8.1\Tools_1\TEMP\Objects\*.* %objfolder% >>%logfile%

Echo "Process of SIF Backup is completed Succesfully." >> %logfile%

Echo "Cleaning for Temp folder Process started." >> %logfile%

echo y | del C:\Siebel\8.1\Tools_1\TEMP\Projects\*.* >NUL >>%logfile%

echo y | del C:\Siebel\8.1\Tools_1\TEMP\Objects\*.* >NUL >>%logfile%

Echo "Cleaning for Temp folder Process is completed Succesfully." >> %logfile%

echo============Ended srcctrl.bat file on %DATE% %TIME%=========>>%logfile%

@echo off >>%logfile%

exit

Version 1.1

@echo off

cls

set UNPADDEDHOURWITHSPACE=%TIME:~0,2%

set /a UNPADDEDHOUR=%UNPADDEDHOURWITHSPACE%

set EXTRAZERO=0%UNPADDEDHOUR%

set HOUR=%EXTRAZERO:~-2%

set curdate=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%

set curtime=%HOUR%-%TIME:~3,2%

set projfolder=C:\Siebel\8.1\Backups\Objects\%curdate%\%curtime%\Projects

set projdatename=C:\Siebel\8.1\Backups\Objects\%curdate%\%curtime%\Projects

set LOGFILE= C:\Siebel\8.1\Backups\logfile.log

@echo on

echo =======================Srcctrl.bat========================== >> %LOGFILE%

@echo off

set /p continue=Do you want to take backup? (y/n)

@echo on

If %continue%==y goto :backup

If %continue%==n goto :END

:backup

mkdir %projdatename%

copy C:\Siebel\8.1\Tools_1\TEMP\Projects\*.* %projfolder%

@echo off

set objfolder=C:\Siebel\8.1\Backups\Objects\%curdate%\%curtime%\Objects

set objdatename=C:\Siebel\8.1\Backups\Objects\%curdate%\%curtime%\Objects

mkdir %objdatename%

copy C:\Siebel\8.1\Tools_1\TEMP\Objects\*.* %objfolder%

@echo on

echo "Backup is taken successfully. Enter any key to exit."

pause

:END

 echo ===================End Of Srcctrl.bat====================== >> %LOGFILE%

Version 1.0

echo =======================Srcctrl.bat========================== >> %LOGFILE%

set UNPADDEDHOURWITHSPACE=%TIME:~0,2%

set /a UNPADDEDHOUR=%UNPADDEDHOURWITHSPACE%

set EXTRAZERO=0%UNPADDEDHOUR%

set HOUR=%EXTRAZERO:~-2%

set curdate=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%

set curtime=%HOUR%-%TIME:~3,2%

set projfolder=C:\Siebel\8.1\Backups\Objects\%curdate%\%curtime%\Projects

set projdatename=C:\Siebel\8.1\Backups\Objects\%curdate%\%curtime%\Projects

mkdir %projdatename%

copy C:\Siebel\8.1\Tools_1\TEMP\Projects\*.* %projfolder%

set objfolder=C:\Siebel\8.1\Backups\Objects\%curdate%\%curtime%\Objects

set objdatename=C:\Siebel\8.1\Backups\Objects\%curdate%\%curtime%\Objects

mkdir %objdatename%

copy C:\Siebel\8.1\Tools_1\TEMP\Objects\*.* %objfolder%

echo ===================End Of Srcctrl.bat====================== >> %LOGFILE%
Advertisements


Categories: Siebel

Tags: , , , , ,

4 replies

  1. Nice Article. is there any possibility of getting the Object Name that’s getting checked in? since the SIF File name replaces every space with _, its difficult to get the Actual Object Name.

    Thanks in Advance!

    • Thanks. SIF it self is a Actual Object. If you want to get the Actual Name then you have to write a different Batch file which will read the SIF and replaces the _ with space.

  2. can you please let me know if there is any possibility of getting the Actual Object name? SIF File name contains the Object Name with _ and its causing trouble in finding the proper Object Name of the object thats being checked in.

    • Thanks. SIF it self is a Actual Object. If you want to get the Actual Name then you have to write a different Batch file which will read the SIF and replaces the _ with space.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: