Highlighted
Absent Member.. Absent Member..
Absent Member..
296 views

iSPI Perf for Metrics database backup

Hi folks

I put together a PowerShell script to run in Task Scheduler to backup the NPS database.  The script errors saying the backup command (backup.ovpl) requires a directory (-b). Are there limitations is using environment vairables with this command? Suggestions are welcome, new to PowerShell scripting here.

Thanks
-LB

$npsBackup = ("C:\Program Files (x86)\HP\HP BTO Software\NNMPerformanceSPI\bin\backup.ovpl")
$emailCmd = ("C:\Program Files (x86)\Blat\blat.exe")
$npsBackupDir = ("D:\nps-database-backup")
$outFile = "C:\Temp\npsBackup.out"
$emailUser = "someUser@domain.com"

if($?)
{
 echo "" >> $outFile
 echo "=========" >> $outFile
 echo "NPS Database Backup Completed Successfully" >> $outFile
 echo "=========" >> $outFile
 echo "" >> $outFile
 & cmd /c $npsBackup –b $npsBackupDir >> $outFile 2>&1
 & cmd /c $emailCmd $outfile -to $emailUser
 & cmd /c del $outFile
}
else
{
 echo "" >> $outFile
 echo "=========" >> $outFile
 echo "NPS Database Backup Failed, check output file $outFile" >> $outFile
 echo "=========" >> $outFile
}

 

0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: iSPI Perf for Metrics database backup

Hello,

It seems the 'long' dash was typed with -b (compare to -to). This may happen if an HTML capable editor was used. Try to retype -b with a minus character.

Best regards,

Sergey Pankratov
NNMi Support

The views expressed in my contributions are my own and do not necessarily reflect the views and strategy of HPE
If you find this or any post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember
to give them a KUDOS and show your appreciation
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.