Run Command After Backup Using SMSQL

I am using SMSQL5.0R1 for x64 backing up SQL 2008 running on Windows 2008 R2 x64.

I have tried to run the following code in the PowerShell window:

new-backup -Server 'LISSQLMNG1' -RetainBackups 5 -BkupSIF -RetainSnapofSnapInfo 5 -Mgmt daily -Command
-RunCommand C:\bat\SMSQL\GetSnapshotName.bat -CmdArgs '$SqlSnapshot'

Basically, I want to backup all the databases on my server, and export the name of the snapshot created to a file so that I could connect them to another server and back them up as a local disk on my backup server.

Here is what I see happening:

Report file will be created on SQLMNG1
Report File Path:
C:\Program Files\NetApp\SnapManager for SQL Server\Report\Run Command [SQLMNG1]\04-12-2010_15.49.56.txt

Time Stamp: 04-12-2010_15.49.56

Run Command Host: SQLMNG1
Command Path:
Command Arguments:
Parsed Command Arguments:

Launching the specified command by shell execute...

Error Code: 0x80004005
Unspecified error

Preparing for Sending Filer AutoSupport...
No filer autosupport message is sent on success.

Error Code: 0x80004005
Unspecified error

An Error occurred in the backup process.Please verify the results.
Details :
Error Code: 0x80004005
Unspecified error

new-backup : The new-backup has completed with errors.
At line:1 char:11
+ new-backup <<<<  -Server 'SQLMNG1' -RetainBackups 5 -BkupSIF -RetainSnapofSnapInfo 5 -Mgmt daily -Command -RunComm
and C:\bat\SMSQL\GetSnapshotName.bat -CmdArgs '$SqlSnapshot'
    + CategoryInfo          : InvalidResult: (SMSQLPSSnapIn.SMSQLBackup:SMSQLBackup) [new-backup], Exception
    + FullyQualifiedErrorId : Error: new-backup,SMSQLPSSnapIn.SMSQLBackup

new-backup : The Backup operation completed with errors.Please check the SnapManager Reports/Windows EventLogs for more
At line:1 char:11
+ new-backup <<<<  -Server 'LISSQLMNG1' -RetainBackups 5 -BkupSIF -RetainSnapofSnapInfo 5 -Mgmt daily -Command -RunComm
and C:\bat\SMSQL\GetSnapshotName.bat -CmdArgs '$SqlSnapshot'
    + CategoryInfo          : OpenError: (SMSQLPSSnapIn.SMSQLBackup:SMSQLBackup) [new-backup], Exception
    + FullyQualifiedErrorId : [new-backup completed with errors],SMSQLPSSnapIn.SMSQLBackup

I see the backup "hang" for a while trying to run "C:\bat\SMSQL\GetSnapshotName.bat" before it times out and returns an error.

The contents of "C:\bat\SMSQL\GetSnapshotName.bat":

REM Output the snapshot name to a text file
echo %1 >> C:\bat\SMSQL\SnapshotNames.txt

I tried renaming the file extension to .cmd, .ps1 - nothing worked. What is going on here?

Also - question 2 - I don't see any snapshots generated for my System Database LUN/Volume on my filer - how can I mount the snapshot of those DBs using SnapDrive?

Re: Run Command After Backup Using SMSQL

Apparently the backup command was timing out when trying to run the batch. I tried a whole slew of different combinations, within the file, file name, quotations - and sporadically - sometimes it worked and sometimes it didn't.

The support team @ NetApp was able to reproduce this in their labs, and the techs suggested to add the following line to the end of the batch file to force it to terminate itself:


There will be a KB published about this soon in the NOW site (so they tell me).

Just to recap - this happened on the latest build of SnapManager for SQL 5.01R1P2, Windows 2008 R2 x64, SQL 2008 SP1 x64.