cancel
Showing results for 
Search instead for 
Did you mean: 

Get scratch tape count for better tape management

monty_222
Level 4
Certified

Here is the script that can go handy for getting a scratch report , you can have it scheduled to run on daily or weekly using windows scheduler.

You can use a bat file to run the below sscript.

 

E:\
CD "E:\Program Files\VERITAS\Volmgr\bin"
 
 
echo ****************List  of scratch tapes **************** > E:\Tapes\scratch.log
echo. >> E:\Tapes\scratch.log
 
vmquery -b -pn Scratch |findstr /i "TLD" >> E:\Tapes\scratch.log
echo. >> E:\Tapes\scratch.log
 
 
 
cscript scratch_rpt_email.vbs
 
ren E:\Tapes\scratch.log scratch.log-%date:~4,2%-%date:~7,2%-%date:~10,4%.txt
 
 
 
You need to create a folder ( E:\Tapes) as in example above for storing the report .
The below script call for the script to email the report, else you can use Blat also for the same. 
 
 
 
 
This will be a .vbs file.
 
 
Set objMessage = CreateObject("CDO.Message") 
objMessage.Subject = "Scratch Report" 
objMessage.From = "mail@mail.com" 
objMessage.To = "mail@mail.com" 
objMessage.TextBody = "Scratch Report "
 
objMessage.AddAttachment "E:\Tapes\scratch.log"
 
 
'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
 
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.mailserver.com"
 
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
 
objMessage.Configuration.Fields.Update
 
'==End remote SMTP server configuration section==
 
objMessage.Send
 
 
1 REPLY 1

rk1074
Level 6
Partner

good one .. :)