About Me

My photo
a Dynamic and Energetic guy.....
Showing posts with label backup script. Show all posts
Showing posts with label backup script. Show all posts

Sunday, June 13, 2010

Sharepoint backup script

(1) Open notepad

(2) type following command

@echo

echo Back up the farm to "Optimus\Share"

echo ===============================================================

For /F "tokens=1,2,3 delims=/ " %%A in ('Date /t') do (

Set Day=%%A

Set Month=%%B

Set Year=%%C

Set todayDate=%%C%%B%%A

)
set WORKINGFOLDER="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN"
pushd "%WORKINGFOLDER:"=%"

cd C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN

echo Starting Backup ========================

stsadm -o backup -url http://optimus:3333 -filename \\Optimus\Share\SharepointPortalBackup_%todayDate%.bak -overwrite


pause


(3) Save the file as .bat or .cmd
(4) Run & test (This will create a backup with the date (SharepointPortalBackup_1406Mon.bak) )
(5) Add a "Task Scheduler" in server

:) :) :) Simple

My Masters