For our source's security, an adminstrator of Microsoft Visual SourceSafe should do a backup daily or weekly at least. The backup process won't cost us a long time, but we prefer automatical backup for sure. Let's introduce how to implement a daily backup by making use of existing tools.
- Tools
- ssarc.exe. ssarc.exe is a backup tool offered by SoureSafe. It's in "win32" directory which is under the installation path of SouceSafe.
- schtasks. In Windows Server 2003, schtasks allows an administrator creating, deleting, querying, configurng, running and stopping local or remote scheduled tasks in system. It is designed to replace at.exe.
- Steps
- Create a batch file names as "backup.bat" in "c:\backup\bin" directory;
- Write the following commands into the file:
1 @echo off
2 @title Backing up SourceSafe databases
3 set SsPath=C:\Program Files\Microsoft Visual Studio\VSS\win32\
4 set BakPath=C:\backup\content\
5 "%SsPath%ssarc.exe" –d- -s"Path to a SourceSafe Database" –i- -yadmin,password
6 –o@"%BakPath%Backup-output(%DATE%).txt" "%BakPath%Backup-Database(%DATE%).ssa" $/
7 echo Finished backups
8 @echo onNote:
- SsPath designates the path to the "win32" directory.
- BakPath appoints the path where backup files are preserved.
- You should replace "Path to a SourceSafe Database" as the path to the "SrcSafe.ini" of a SourceSafe database.
- Please replace "Password" as the administrator's password.
- After a backup process, there will be two generated files under "c:\backup\content":
Backup-output(2004-11-01).txt: the output file
Backup-Database(2004-11-01).ssa: the backup file generated by SourceSafe.2004-11-01 appoints the date when the backup operation is carrying out.
- Use schtasks to create a scheduled task.
1
2schtasks /create /RU system /SC DAILY /ST 12:00 /TN "SourceSafe Backup" /TR "cmd /c C:\backup\bin\backup.bat"
3Note:
- /RU system, run the command under "NT AUTHORITY\SYSTEM" account.
- /SC DAILY, run the command one time a day. Valid values are MINUTE, HOURLY, DAILY, WEEKLY, MONTHLY, ONCE, ONSTART, ONLOGON, ONIDLE.
- /ST 12:00 specifies the program will be started at 12:00.
- /TN "SourceSafe Backup" specifies the name of the scheduled task.
- /TR "cmd /c c:\backup\bin\backup.bat" specifies the program to be executed.
- Congratulations, you have successfully created a scheduled task to implement the daily backup process. When type "schtasks" at command line, you can find "SourceSafe Backup" in the column called "Task Name".
- References
- Microsoft Visual SourceSafe Reference Guide(SSUSEXP.CHM).
The file is located in the SourceSafe's installation directory, or you can find it in msdn web site. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/guides/html/vsoriReferenceGuide.asp - Microsoft Visual SourceSafe Best Practices.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvss/html/vssbest.asp - HOW TO: Use Schtasks.exe to Schedule Tasks in Windows Server 2003
http://support.microsoft.com/default.aspx?scid=kb;en-us;814596
- Microsoft Visual SourceSafe Reference Guide(SSUSEXP.CHM).