To create a batch file
1. Click Start, and then click Run.
2. Type notepad, and then click OK.
3. In Notepad, type the following text:
@echo off
Echo ------------------------------------------------------------------
@SET STSADM="D:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM"
@SET MAINSITEURL="http://moss2007/sites/test"
@SET BACKUPFILENAME="E:\test\Backup\%date:~10,4%_%date:~4,2%_%date:~7,2%_backup.bak"
Echo Getting Site Lock
%STSADM% -o getsitelock -url %MAINSITEURL%
Echo Setting Site Lock to ReadOnly
%STSADM% -o setsitelock -url %MAINSITEURL% -lock readonly
Echo Backing up the top level site
%STSADM% -o backup -url %MAINSITEURL% -filename %BACKUPFILENAME% -overwrite
Echo Setting Site Lock to None
%STSADM% -o setsitelock -url %MAINSITEURL% -lock none
Echo ------------------------------------------------------------------
4. In Notepad, on the File menu, click Save As.
5. In the Save As box, select the folder where you want to keep your batch file.
6. Using the ".bat" file name extension, type the name of the file in the File name box, for example, backup_batch.bat.
7. In the Save as type box, click All files.
8. Click Save.
Use Task Scheduler to run a batch file that backs up Office SharePoint Server 2007
To schedule a backup
1. Click Start, and then click Run.
2. Type control, and then click OK.
3. Double-click Scheduled Tasks.
4. Double-click Add Scheduled Task.
5. When the Scheduled Task Wizard appears, click Next.
6. Click Browse, and then browse to and select the batch file that you just created. (See IMAGE-1)
1. Click Start, and then click Run.
2. Type notepad, and then click OK.
3. In Notepad, type the following text:
@echo off
Echo ------------------------------------------------------------------
@SET STSADM="D:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM"
@SET MAINSITEURL="http://moss2007/sites/test"
@SET BACKUPFILENAME="E:\test\Backup\%date:~10,4%_%date:~4,2%_%date:~7,2%_backup.bak"
Echo Getting Site Lock
%STSADM% -o getsitelock -url %MAINSITEURL%
Echo Setting Site Lock to ReadOnly
%STSADM% -o setsitelock -url %MAINSITEURL% -lock readonly
Echo Backing up the top level site
%STSADM% -o backup -url %MAINSITEURL% -filename %BACKUPFILENAME% -overwrite
Echo Setting Site Lock to None
%STSADM% -o setsitelock -url %MAINSITEURL% -lock none
Echo ------------------------------------------------------------------
4. In Notepad, on the File menu, click Save As.
5. In the Save As box, select the folder where you want to keep your batch file.
6. Using the ".bat" file name extension, type the name of the file in the File name box, for example, backup_batch.bat.
7. In the Save as type box, click All files.
8. Click Save.
Use Task Scheduler to run a batch file that backs up Office SharePoint Server 2007
To schedule a backup
1. Click Start, and then click Run.
2. Type control, and then click OK.
3. Double-click Scheduled Tasks.
4. Double-click Add Scheduled Task.
5. When the Scheduled Task Wizard appears, click Next.
6. Click Browse, and then browse to and select the batch file that you just created. (See IMAGE-1)
7. Click Open.
8. Type a name for your task, for example, backup_batch. (See IMAGE-2)
9. Select how often you want this task performed (for example, weekly), and then click Next.
10. Select a day and time that you want this task to begin, and then click Next.
11. Enter a name and password for a user, and then click Next. This task will run as if it were started by that user.
12. Click Finish. (See IMAGE-3)
No comments:
Post a Comment