Create .bat file on the web end server copy and paste the below:
Start
'by : Ahmad Madkhana 25/9/2009
@For /F "tokens=1 delims= " %%A in ('Date /t') do @( Set DayName=%%A ) @echo DAY = %DayName%
@echo off
echo ====================================================
echo Backup Script For Office SharePoint Server 2007
echo ====================================================
@echo off
if %DayName%==Sun RD D:\Backup\Sun /S /Q
if %DayName%==Sun MD D:\Backup\Sun
if %DayName%==Sun stsadm.exe -o backup -directory "\\servername\Backup\Sun" -backupmethod full -item "Farm" -overwrite
if %DayName%==Mon RD D:\Backup\Mon /S /Q
if %DayName%==Mon MD D:\Backup\Mon
if %DayName%==Mon stsadm.exe -o backup -directory "\\servername\Backup\Mon" -backupmethod full -item "Farm" -overwrite
if %DayName%==Tue RD D:\Backup\Tue /S /Q
if %DayName%==Tue MD D:\Backup\Tue
if %DayName%==Tue stsadm.exe -o backup -directory "\\servername\Backup\Tue" -backupmethod full -item "Farm" -overwrite
if %DayName%==Wed RD D:\Backup\Wed /S /Q
if %DayName%==Wed MD D:\Backup\Wed
if %DayName%==Wed stsadm.exe -o backup -directory "\\servername\Backup\Wed" -backupmethod full -item "Farm" -overwrite
if %DayName%==Thu RD D:\Backup\Thu /S /Q
if %DayName%==Thu MD D:\Backup\Thu
if %DayName%==Thu stsadm.exe -o backup -directory "\\servername\Backup\Thu" -backupmethod full -item "Farm" -overwrite
@echo off
echo completed
End
In this example backup folders are located on the server D:\Backup folder
inside this folder there should be 7 folders for each day.
schedule the backup to run daily, and the batch file will overwrite the old backup weekly.
Regards,
Ahmad Madkhana
Monday, October 12, 2009
Subscribe to:
Post Comments (Atom)
2 comments:
thank you Ahmed for your cooperation i think you are best share point administrator in middle east...
join the syrian bloggers comunity on www.syplanet.com
Post a Comment