Tuesday, April 05, 2011

Backup Script

If you want to create backup script of data that you want to take backup on daily basis using some batch process and windows scheduler then below is the right option to go with. Copy below stuff in notepad and save it as .bat file and add to scheduler.

@ECHO OFF
CLS
SET DD=%DATE:~7,2%
SET MM=%DATE:~4,2%
SET YYYY=%DATE:~10,4%
SET HH=%TIME:~0,2%
SET MN=%TIME:~3,2%
SET SS=%TIME:~6,2%
SET FOLDER="%YYYY%-%MM%-%DD%-%HH%-%MN%-%SS%"
::START COPY WSSERVICE
xcopy "\\sharedlocation\website\wsService" d:\buildbackup\%FOLDER%\wsService /i /S /E /H /R /Y
::END COPY WSSERVICE

No comments: