Making Backup and Restore Script

Making Backup and Restore Script

@echo off
@echo --------------------------------------------------------
@echo Backing Up site http://localhost/
@echo --------------------------------------------------------

cd \Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

@echo Generating File Name using current Date Time and Year
FOR /F "TOKENS=1,2 DELIMS=/ " %%A IN ('DATE /T') DO SET mm=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('DATE /T') DO SET dd=%%B
FOR /F "TOKENS=3* DELIMS=/ " %%A IN ('DATE /T') DO SET yyyy=%%B

set bDate=%mm%%dd%%yyyy%
echo %bDate%

@echo off

stsadm -o backup -url http://localhost/  -filename "D:\Backup\backup_%bDate%.bak"
@echo Backup Completed

 

Leave a Comment
  • Please add 1 and 6 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Richard Mueller edited Revision 4. Comment: Removed extra space in tag "SharePoint  2010"

  • Balaji M Kundalam edited Revision 2. Comment: Added tags

  • Richard Mueller edited Revision 1. Comment: Removed (en-US) from title, added tags

  • Patris_70 edited Original. Comment: added en-US title and tag

Page 1 of 1 (4 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
Page 1 of 1 (7 items)