Networker

Re: [Networker] Scripting help

2011-12-06 19:02:21
Subject: Re: [Networker] Scripting help
From: Mathew Harvest <Mathew.HARVEST AT COMMUNITIES.QLD.GOV DOT AU>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Wed, 7 Dec 2011 09:59:06 +1000
Hey,

It's been a long time since I have done batch scripting .... and what I do 
remember from it, is that its really limited in what you can do ...

You can't have nested for loops, there is some restriction around being able to 
set a variable inside a for loop ... other than the tokens defined in the loop.

I haven't tested the script below, but you could possibly break it out into 
something like below 

jsrjb >nsrjb.out
FOR /F %%A IN ('mminfo -q "client=client_name,savetime>=today" -ot -r barcode') 
DO
  type nsrjb.out | find /i "%%A" >>tapelist.out

FOR /F %%A IN ('type tapelist.out') DO
  nsrmm -o readonly "%%A"



Mat 


-----Original Message-----
From: EMC NetWorker discussion [mailto:NETWORKER AT LISTSERV.TEMPLE DOT EDU] On 
Behalf Of tlamana
Sent: Wednesday, 7 December 2011 4:21 AM
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Subject: [Networker] Scripting help

How can this script:

FOR /F %%A IN ('mminfo -q "client=client_name,savetime>=today" -ot -r barcode') 
DO FOR /F "skip=3 tokens=1,2,3 delims=: " %%B IN ('nsrjb') DO IF %%A==%%C 
match.bat %%B %%A

be stripped down to just search for volumenames then insert the volumename 
into: nsrmm -o readonly "volumename"?


There will only be two tapes for any given day so I am thinking that the nsrmm 
command would have to be listed twice.

+----------------------------------------------------------------------
|This was sent by tlamana AT saddlewest DOT com via Backup Central.
|Forward SPAM to abuse AT backupcentral DOT com.
+----------------------------------------------------------------------

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the body of the email. Please write to 
networker-request AT listserv.temple DOT edu if you have any problems with this 
list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or via RSS at 
http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

*********************************DISCLAIMER*********************************


The information contained in the above e-mail message or messages
(which includes any attachments) is confidential and may be legally
privileged. It is intended only for the use of the person or entity
to which it is addressed. If you are not the addressee any form of
disclosure, copying, modification, distribution or any action taken
or omitted in reliance on the information is unauthorised. Opinions
contained in the message(s) do not necessarily reflect the opinions
of the Queensland Government and its authorities. If you received
this communication in error, please notify the sender immediately
and delete it from your computer system network.

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the body of the email. Please write to 
networker-request AT listserv.temple DOT edu if you have any problems with this 
list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

<Prev in Thread] Current Thread [Next in Thread>