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 which was a bug in previous version 1.0 and 1.1 if Undo Checkout is done in Siebel.

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

____________________________________________________________

____________________________________________________________

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%

Advertisements


Categories: Siebel

Tags: , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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

%d bloggers like this: