CCG3
asked on
Change bat file to email failures
Hello Everyone, I run a batch file that backs up a local copy of my SharePoint Server and then copies that backup file to a NAS server where I later back it up to tape or disk. I was wondering if based on the following lines that I have in my script if there was some way to determane if it failed and if so can I send myself an email that if failed.
Here is what I run each evening to get my backup....
cd %programfiles%\Common Files\Microsoft Shared\web server extensions\12\BIN
stsadm.exe -o backup -url https://SHAREPOINTSITE -filename C:\SharePointBak\SPSiteBak .dat -overwrite
xcopy "C:\SharePointBak" "\\NAS DATA SERVER\SharePoint Backup" /e /y
Here is what I run each evening to get my backup....
cd %programfiles%\Common Files\Microsoft Shared\web server extensions\12\BIN
stsadm.exe -o backup -url https://SHAREPOINTSITE -filename C:\SharePointBak\SPSiteBak
xcopy "C:\SharePointBak" "\\NAS DATA SERVER\SharePoint Backup" /e /y
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That would only notify you if the backup failed, not if the backup succeeded and the copy failed.
Maybe you could modify that so that there is 2 spots to send an email? One to send an email saying the Backup Failed, and another that said the copy failed but the backup succeeded.
Maybe you could modify that so that there is 2 spots to send an email? One to send an email saying the Backup Failed, and another that said the copy failed but the backup succeeded.
ASKER
That is a great suggestion Grasty! How would i do that?
I created a vbs to send an email and I am calling that vbs to send an email if it fails to backup. How would I determine if the copy fails and then send an email if it does?
I created a vbs to send an email and I am calling that vbs to send an email if it fails to backup. How would I determine if the copy fails and then send an email if it does?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I agree, Daz's should work great for you (once you put in your calls for the vbs script you have of course.
ASKER
Thanks guys! I was able to set this up and test it yesterday and I ran it live last night. Everything seems to be fine. Thanks for your help!!
I would do something like this:
Open in new window
Hope this helps,
Daz.
[1] http://blogs.msdn.com/b/markarend/archive/2007/11/08/scripting-stsadm-commands.aspx