Start a Conversation

Solved!

Go to Solution

944

June 6th, 2019 06:00

recover in no interactive mode and wildcards

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 -d /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

2.4K Posts

June 6th, 2019 08:00

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.

 

June 7th, 2019 02:00

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.

 

2.4K Posts

June 7th, 2019 13:00

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.

 

June 10th, 2019 06:00

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

June 12th, 2019 03:00

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.

No Events found!

Top