Highlighted
AndreaBolo
1 Nickel

recover in no interactive mode and wildcards

Jump to solution

Hello,

we need to recover only some files using wildcard * from a shell script.
We saved all files under directory "/some_path/dir_name" and now we need to recover only some files with name beginning with aaa from that directory via a shell script.


It seems to me that with networker is not possible to use wildcards in recover.

I tried:

/usr/bin/recover -a -t <date> -d <destination> /some_path/dir_name/aaa*

and it returns:

67847:recover: Failed to recover files: Nothing to recover

when I set the exact filename not using wildcard, it works.


It is not possible to use wildcards with recover command with no interactive browsing in networker ?

Thanks

Andrea

0 Kudos
1 Solution

Accepted Solutions
bingo.1
3 Cadmium

Re: recover in no interactive mode and wildcards

Jump to solution

The issue is that you are running linux.

Here you can in fact create files and directories which contain a '*' in their name.

 

In case of your task I see two possibilities:

  -  run nsrinfo on that savetime first and filter the exact path names to recover. Then add these names to a recover list.

  -  restore the whole save set to temp directory and get your files from here.

 

0 Kudos
5 Replies
bingo.1
3 Cadmium

Re: recover in no interactive mode and wildcards

Jump to solution

The issue is that you are running linux.

Here you can in fact create files and directories which contain a '*' in their name.

 

In case of your task I see two possibilities:

  -  run nsrinfo on that savetime first and filter the exact path names to recover. Then add these names to a recover list.

  -  restore the whole save set to temp directory and get your files from here.

 

0 Kudos
AndreaBolo
1 Nickel

Re: recover in no interactive mode and wildcards

Jump to solution

Thank you, bingo.1, for your suggestion.

It'a a pity that networker doesn't allow this.
I'll try using some grep with nsrinfo output. It's linux.
I'd like to have a smart and easy way to do this. 
When done, I'll post results for future. 

Thank you, again.

 

0 Kudos
bingo.1
3 Cadmium

Re: recover in no interactive mode and wildcards

Jump to solution

Sorry, but you are wrong. NW in fact would allow it.

As I mentioned, a '*' is a valid character for a Linux file-/dirname he is just wlking through the file index but we will not find it.

 

0 Kudos
AndreaBolo
1 Nickel

Re: recover in no interactive mode and wildcards

Jump to solution

I was referring to the fact that NW doesn't allow to use the char '*' as wildcard in a recover command.

0 Kudos
AndreaBolo
1 Nickel

Re: recover in no interactive mode and wildcards

Jump to solution

Thanks to bingo.1's suggestions, I solved using the following.

#how to restore all, previously backed up from client client_name, files beginning with "aaa" under directory "/some_path/dir_name" using a shell script in linux

# search latest nsavetime in time interval between time1 - time2 and set variabile MMINFO_NSAVETIME
MMINFO_NSAVETIME=`/usr/sbin/mminfo -ot -s backup_server -q "savetime>=$time1,savetime<=$time2,client=client_name" -r"name,nsavetime" |tail -1|awk '{print $2}'`

# search from that nsavetime the recover list with file pathname beginning with "/some_path/dir_name/aaa" and output the recover list to file "/tmp/recover_list.txt"
/usr/sbin/nsrinfo -t $MMINFO_NSAVETIME -s backup_server client_name|grep /some_path/dir_name/aaa > /tmp/recover_list.txt

# using the list start to recover files under /another_path. File overwrite is on.
/usr/bin/recover -a -c client_name -s backup_server -t $MMINFO_NSAVETIME -iY -d /another_path -I /tmp/recover_list.txt > /tmp/recovery_file.log

Hope it helps.

0 Kudos