Networker

Re: [Networker] Automate device creation / deletion ?

2008-03-10 15:35:10
Subject: Re: [Networker] Automate device creation / deletion ?
From: A Darren Dunham <ddunham AT TAOS DOT COM>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Mon, 10 Mar 2008 19:31:13 +0000
On Sat, Mar 08, 2008 at 07:52:36PM -0500, Roger Penrose wrote:
> On *nix server there ARE ways, but they are clunky at best, for example here
> is a delete of "mydevice" using piped commands to nsradmin :
> 
> ( echo ". type: NSR device; name: mydevice" ; echo "show name" ; print ;
> echo delete ) | /usr/sbin/nsradmin -i -

As a minor point, I'd rearrange that so it's a bit shorter:

printf "show name\nprint type:NSR device; name:mydevice\n" | nsradmin -i -

But that's unlikely to change someone's definition of it to "less
clunky".

> My question is, what methods do users on the list use to create or
> destroy many devices in NetWorker so that this can be scripted most
> efficiently?

I don't do this so often that I've felt a great need to script it, but
that's exactly how I'd do it.  Or probably use a bit more logic in a
perl script.  That way I'd have a bit more flexibility to parsing the
output. 

> Also, if possible, I would greatly appreciate methods on Windows as well as
> *nix?

Should work just the same.  The only difference is that you don't have a
shell built-in.  I generally install perl and run all my scripts in
perl.  But shells like bash are available as well.  

I would suppose that batch scripts are possible as well, but I don't use
them enough to know their limits.

-- 
Darren Dunham                                           ddunham AT taos DOT com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >

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>