Symantec NetBackup 7.1 自动刷新磁带脚本
生活随笔
收集整理的這篇文章主要介紹了
Symantec NetBackup 7.1 自动刷新磁带脚本
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
郵件收發功能使用說明 使用目的:該程序用于實現物理帶庫添加磁帶后自動清點功能。 程序組成:有兩個腳本組成,netbackup.bat和sendmail.vbs。 存放目錄:D:\nbu_inventory_daily下 運行機制:該程序由Windows操作系統的計劃任務調用執行,每天下午5點發起調用操作。執行時,先執行netbackup.bat進行磁帶庫的清點操作,并記錄報告;然后會自動調用sendmail.vbs,并完成郵件發送功能,將報告以附件形式發出。 相關參數:在netbackup.bat腳本中,
vmupdate.exe,實現帶庫的清點操作,并記錄報告。
之后,自動調用sendmail.vbs腳本。 在sendmail.vbs腳本中,
Email.From,是郵件發送人;
Email.To,是郵件收件人;
Email.Cc,是郵件抄送人;
Email.Bcc,是郵件密送人;
Email.Subject,是郵件標題;
Email.Textbody,是郵件內容。 --netbackup 腳本:"C:\Program Files\Veritas\Volmgr\bin\vmupdate.exe" -rt TLD -rn 2 -mt HCART2 -p offline_ppool -h ccn-nbu-clu > D:\nbu_inventory_daily\%date:~-4%%date:~-10,-8%%date:~-7,-5%.txt
D:\nbu_inventory_daily\sendmail.vbs --sendmail NameSpace = "http://schemas.microsoft.com/cdo/configuration/"
Function sbday
sbday=FormatDateTime(now,2)
End Function
yy=right("0000"&year(sbday),4)
mm=right("00"&month(sbday),2)
dd=right("00"&day(sbday),2)
sdt=yy & mm & dd
file="D:\nbu_inventory_daily\" & sdt & ".txt" Set Email = CreateObject("CDO.Message")
Email.From = "ccn-nbu-clu@canon.com.cn"
Email.To = mail@sina.com.cn
Email.Cc = "mail@sina.com.cn"
Email.Bcc = "mail@sina.com.cn" Const ForReading = 1, ForWriting = 2, ForAppending = 8
dim fso, f
Set fso = Createobject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(file, ForReading)
BodyText = f.ReadAll
'Set o = CreateObject("Scripting.FileSystemObject")
's = o.OpenTextFile( file ).ReadAll()
's = o.OpenTextFile(file).ReadAll()
'If InStr(s, "Volume configuration is up-to-date with robot contents.") <> 0 Then
'Email.Subject = "normal" 'Else
'If InStr(s, "Volume configuration successfully updated") <> 0 Then
'Email.Subject = "success"
'Else
'Email.Subject = "faild"
'End if
'End if f.Close
Set f = Nothing
Set fso = Nothing Email.Subject = sdt & "ccn-nbu-clu check report"
Email.Textbody = BodyText 'Email.AddAttachment file
With Email.Configuration.Fields
.Item(NameSpace&"sendusing") = 2
.Item(NameSpace&"smtpserver") = "ccn-bj-hub01.cn.canon-asia.com"
.Item(NameSpace&"smtpserverport") = 25
.Item(NameSpace&"smtpauthenticate") = 1
.Update
End With
Email.Send
?
轉載于:https://blog.51cto.com/terrynie/1076717
總結
以上是生活随笔為你收集整理的Symantec NetBackup 7.1 自动刷新磁带脚本的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MySql入门笔记二~悲催的用户
- 下一篇: Silverlight 导入数据时读取t