In remembrance of one of my math teachers back at school who always said KISS (Keep It Simple Stupid) I made a very simple and quick backup script for a SharePoint portal at a customer test farm. When scheduled right it makes a backup, lets say, every hour and renames older backup files.
CD\
CD BACKUP
IF NOT EXIST backup11.dat GOTO make11
echo Y | del backup11.dat
:make11
IF NOT EXIST backup10.dat GOTO make10
RENAME backup10.dat backup11.dat
[...]
:make2
IF NOT EXIST backup1.dat GOTO make1
RENAME backup1.dat backup2.dat
:make1
IF NOT EXIST backup.dat GOTO make0
RENAME backup.dat backup1.dat
:make0
“C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe” -o backup -url http://moss.example.com -filename C:\Backup\backup.dat -overwrite
EXIT
Tags: backup & restore, stsadm


November 27th, 2008 at 8:49 AM
Can this also be done by using Powershell?
November 27th, 2008 at 10:08 AM
Hello Carl
Thanks for your comment. I don’t know if it can be done in Powershell but it is interesting to look into. I shall try to write a Powershell script for this task. Good point.