Networker

Re: [Networker] Multple Streams for one mount point

2004-01-29 20:31:37
Subject: Re: [Networker] Multple Streams for one mount point
From: Darren Dunham <ddunham AT TAOS DOT COM>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Thu, 29 Jan 2004 17:31:39 -0800
> > An alternative is to have a script with visibility to the directory that
> > can examine the contents, then modify the 'save set' attribute for the
> > client.
>
> That's an interesting approach. Since I'm exploring this option myself
> do you have such a script handy as something I can look at and work
> from?

Not really.  I was also thinking that you'd have to have every single
directory in the parent directory be a separate job (saveset).  With
NetBackup, you could combine some of them into a single job (stream).
That's nice if you have 2 HUGE directories and 3 small ones.  Running
the 3 small ones as a job would be nice.

Anyway, all you generally want to do is..

1) Look in your directory for all files and directories
2) Compile them into a list
3) run nsradmin and shove them into the client saveset.

So assuming you're on the target machine and you have write access to
the networker server, something like this...

(top of my head, do not run until you prove it works...)

#!/usr/bin/perl -w
use Sys::Hostname;
use strict;

my $parent_directory = '/usr/local/lots-o-stuff';
opendir (DIR, $parent_directory) or
  die "Couldn't open $parent_directory. $!\n";
my @files = readdir(DIR);
closedir DIR;
@files = grep { $_ !~ /^\.\.?$/ } @files;
@files = map { "$parent_directory/" . $_ } @files;

# besides the stuff in the parent directory, you'd like to make
# sure you save the other filesystems.  You'd do this either in another
# client instance, or in this one.
# my @other_savesets = qw{ / /usr /var /opt };
# push (@files, @other savesets);

# or perhaps you have another script that looks for your savesets

my $saveset = join ' ', @files;

my $nsr_server = 'server';
my $client = hostname;

open (ADMIN, "|nsradmin -s $nsr_server -i -") or
  die "Couldn't open pipe to nsradmin. $!\n";
print ADMIN ". type:nsr client;name: $client\n";
print ADMIN "update save set: $saveset;\n"
# note: no error checking...
close ADMIN;

One problem for me in typing this is that you might have multiple client
instances, and you only want to update one of them.  If so, you'd have
to change the first command to nsradmin to select only the correct
instance, not all of the ones for this client. (ouch)

The other method is probably a bit easier to maintain... :-)


--
Darren Dunham                                           ddunham AT taos DOT com
Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >

--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=