Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripting nsrclone on Windows2003

Status
Not open for further replies.

Calippo

Technical User
Sep 28, 2007
62
GB
I would like to input mminfo output into my nsrclone command without creating a batch file. In other words just run one command.

My mminfo command is:
mminfo -r ssid -q !incomplete,group=DailySQL,pool=DailyDisky

The above command provides the saveset list I need.
But how can I input this into nsrclone -b DailyClone -S ???

I have tried the following two commands which both fail:
for i in $(mminfo -r ssid -q "!incomplete,group=DailySQL,pool=DailyDisky");do;nsrclone -S "$i";done

for /F %i in (mminfo -r ssid -q "!incomplete,group=DailySQL,pool=DailyDisky");do;nsrclone -S "$i";done

Any ideas where I am going wrong?
Ps... this is NetWorker 7.3.3 on Windows 2003.

Thanks
Ross
 
Hi, try this instead:

for /F %i in ('mminfo -r ssid -q "!incomplete,group=DailySQL,pool=DailyDisky"' do nsrclone -S %i
 
Hi rif

Thanks for you interest but your suggestion isnt working. I get the following:

E:\>for /F %i in ('mminfo -r ssid -q "!incomplete,group=DailySQL,pool=DailyDisky"' do nsrc
lone -b DatStage -S %i
More?


You'll have to forgive my ignorance of scripting... maybe my syntax is wrong but I know my mminfo and my nsrclone commands are good as they both work fine outsite of this script.

Any ideas?
 
Hi, yes I got the same after copying the text from here. It is the ´ that is not working correct. Should be ` to be working around the mminfo statement.
 
Hi Folks

I managed to get the command working but the odd thing is that the command was cloning the savesets from both volumes (ie, from Volume & Volume.RO), so I had duplicates. Obviously this problem would not be apparent if my source volume was a tape but in my case its AFTD. The only workaround I found was to nail the query down on the volume name.
Here is the working command:
for /F %i in ('C:\PROGRA~1\Legato\nsr\bin\mminfo.exe -av -q "!incomplete,volume=B2D:001.RO,group=DailySQL" -r ssid') do C:\PROGRA~1\Legato\nsr\bin\nsrclone.exe -b Datstage -S %i

I tried to use uniq.exe but it didnt work.
Any ideas??

regards
 
This effect is obvious - as the AFTD creates 2 save set entries in the media db for each save set. So it is a good practice to also look for the volume as you did.

Then report not only the ssid but ssid/cloneid and use this info as input for the nsrclone command.
 
Hi,

Yep, using the volume instead of pool is what I usually do when it comes to scripting with ADFT. If you have more than one ADFT it is easy to extend your mminfo query to also collect the ssid/cloneid from them too.
 
try this :

mminfo -r "ssid" -q "my coorect Query" >sidlist.txt
nsrclone -b myclonepool -S -f sidlist.txt
 
Hi a060463xyz
Thanks for your suggested but we are way beyond that simple example of yours.
 
Just modify you script as follows:

for /F %i in ('C:\PROGRA~1\Legato\nsr\bin\mminfo.exe -av -q "!incomplete,volume=B2D:001.RO,group=DailySQL" -r ssid/cloneid') do C:\PROGRA~1\Legato\nsr\bin\nsrclone.exe -b Datstage -S %i

This should do the job.
 
Thanks 605... thats identical to the posting I made on 5th October so you dont get a goldstar this time.
I think I better close this thread.
 
Please read carefullly ... and find the difference ;-)
 
Hi Mr 605

Oh yes, you have added the /cloneid to the report section of the command. The thing is that the '/' (aka slash) character is not a valid seperator in the mminfo report constraint.

I get the following when using your command:
C:\>for /F %i in ('C:\PROGRA~1\Legato\nsr\bin\mminfo.exe -av -q "!incomplete,savetim
e>=11/04/07,group=DailySQL" -r ssid/cloneid') do C:\PROGRA~1\Legato\nsr\bin\nsrclone
.exe -b DatStage -S %i

C:\>C:\PROGRA~1\Legato~1.200\nsr\bin\nsrclone.exe -b DatStage -S unknown
unknown is not a valid save set

C:\>C:\PROGRA~1\Legato~1.200\nsr\bin\nsrclone.exe -b DatStage -S usage:
usage: is not a valid save set

C:\>C:\PROGRA~1\Legato~1.200\nsr\bin\nsrclone.exe -b DatStage -S <report>:
<report>: is not a valid save set

C:\>C:\PROGRA~1\Legato~1.200\nsr\bin\nsrclone.exe -b DatStage -S <query>:
<query>: is not a valid save set


I believe this is because a ',' (aka comma) is required as a seperator. What you think?
In either case, I found the solution one month ago and I am happy with that so thanks to all with there ideas.
 
Sorry, of course you are right. I just forgot about that. It should read as follows:

for /F %i in ('C:\PROGRA~1\Legato\nsr\bin\mminfo.exe -av -q "!incomplete,volume=B2D:001.RO,group=DailySQL" -r "ssid,cloneid") do C:\PROGRA~1\Legato\nsr\bin\nsrclone.exe -b Datstage -S %i

Please apologize that i do not know how to add the cloneid to the SSID for the clone command. But here it should read "ssid/cloneid".

 
Hi 605
I know there is something in Unix one can do to overcome that little matter but on Windows I think not. The mminfo command is now correct but as you know it cant be imported into the nsrclone command as ssid,cloneid. So, we have to filter on the .RO volume name and use just the ssid of which there is only on instance on any one volume plus ensure that the volume name remains constant with the correct nsrmm command.

Regards
 
Hi,

since the query is only for the RO volume there is no need to add the cloneid in the query. Reason for querying the RO volume would be to only get each ssid once from the query. When cloning the RO volume will be used for reading unless cloneid is specified.

However if you for some other reason want to get it in a ssid/cloneid format you can add -xc/ to your mminfo, i.e.

mminfo -av -xc/ -r ssid,cloneid
 
Hi Rif
Yes, I know.
However, by using -xc/ (to export the output into delimted format) the first line of the exported output is going to be the header and this header causes an error because it is not a ssid or cloneid. I tried that also last month.

No more suggestions please I figured this out last month.

thanks guys
 
Just to finally clarify the facts:

Of course, you can add the "ssid/cloneid" argument to the nsrclone command via a file.
If the line would be in this style, you may run "nsrclone -S -f file" to start the process.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top