Re: [Networker] Looking for ssid's that contain a backup of certain file
2010-09-03 07:44:12
Hi and thanks for the help.
As Francis mentioned I can also just use nsrinfo like this:
nsrinfo -N <path_to_file> <client_name>
If the file is in the index, it will list up the savetime of the ssid that
contains the file.
Johannes
-----Original Message-----
From: Abad Uriarte, Arkaitz [mailto:arkaitz.abad AT ehu DOT es]
Sent: 3. september 2010 11:29
To: EMC NetWorker discussion; Jóhannes Karl Karlsson
Cc: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Subject: Re: [Networker] Looking for ssid's that contain a backup of certain
file
Hello;
In these link you have a example of perl script to search in index:
http://www.adsm.org/lists/html/Networker/2009-07/msg00101.html
++++++++++++++
I stripped out some corporate specific info from here... please let me know
if you have a run time problem with this. This script is more for finding a
single file in a client's history and recovering it.
Usages:
searchclient.pl someclient "\.mp3$" "\.txt"
Result:
# ./search_client.pl unixclient '\.txt$' '\.mp3$'
Searching for strings(s): \.txt$ \.mp3$...
Processing 1247533332 (Mon Jul 13 20:02:12 2009) [0/443] ...
1247533332: /local/.../fontconfig-user.txt
1247533332: /local/.../fontconfig-devel.TXT
...
Recovery commands:
recover -t 1247533332 -a "/local/.../fontconfig-user.txt" [OFF070 offline]
recover -t 1247533332 -a "/local/.../fontconfig-devel.TXT" [OFF070 offline]
---- SCRIPT searchclient.pl BELOW ---
#!/usr/bin/perl
if (!@ARGV){
die "Usage: $0 client [-a] <search string>\n\t -a -- search group Archive
only\n";
}
$client = shift;
foreach $arg (@ARGV) {
if ($arg =~ /-a/) {
$arguments = " -q group=Archive ";
} else {
push @searchstrings,$arg;
}
}
if (@searchstrings) {
print "Searching for strings(s): " . join(" ",@searchstrings) . "... \n";
}
my @data = `mminfo -r nsavetime -v $arguments -c $client`;
chomp(@data);
if (!@data) {
die "ERROR: Unable to get list of savetimes - check mminfo query";
}
$totalepochs = $#data;
foreach my $epoch (reverse(@data)){
$epoch =~ s/ *//g;
chomp;
my $tm = localtime($epoch);
print "\nProcessing $epoch ($tm) [" . $epochs++ . "/$totalepochs] ...\n";
open(IN, "nsrinfo -t $epoch $client|") || die "Cannot run nsrinfo ";
$results=0;
while(<IN>){
$results++;
chomp;
if (@searchstrings) {
foreach $x (@searchstrings) {
if (/$x/i) {
$found++;
}
}
if ($found) {
print "\n$epoch: $_\n";
$tapequery = "-q savetime=" . $epoch . ",client=" . $client .
",!near";
$tapes = `mminfo -r volume $tapequery`;
$messages .= "recover -t $epoch -a \"$_\"";
if ($tapes) {
$tapes =~ s/\n/ /g;
$messages .= " [" . $tapes . "offline]";
}
$messages .= "\n";
$found = 0;
}
} else {
print "$epoch: $_\n";
}
}
close(IN);
print "Searched $results files.\n";
}
if ($messages) {
print "\n\nRecovery commands:\n$messages\n";
}
++++++++++++++
Arkaitz
----------------------------------------------------------------------
ARKAITZ ABAD URIARTE
Euskal Herriko Unibertsitatea Email: arkaitz.abad @ehu.es
Bizkaiko I.I.S.I.G Tel. : 94 601 8390
----------------------------------------------------------------------
Aurreztu papera. E-posta hau inprimatu beharra daukazu?
JKK <johannes.karlsson AT SKYRR DOT IS> escribió:
> Hi folks.
>
> I need to find the backups that contain a certain file. The file has been
> backed up a few times and then was deleted.
>
> Can I somehow query NetWorker about what ssid's contain a backup of this
> file?
>
> Johannes
>
> 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
>
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
|
|
|