Video Screencast Help

unable to restore 20K files

Created: 15 May 2013 • Updated: 24 May 2013 | 15 comments
This issue has been solved. See solution.

Hi folks

we hav a restore to perform from a unix server. one of directories contain 40K files, one of customer has requested to all .SAF files out of those 40000 files.manually its not possible.please tell me how do i restore them through command line. from server A to server B , server A to server A.

please explain in simple terms.

Operating Systems:

Comments 15 CommentsJump to latest comment

bills's picture

You can do it with bplist and bprestore.

bplist -B -C <client> -s <start-date> -R /

don't forget the "-R /"!

This will list ALL files backed up from client since start-date.  You can play around with additional options to tweak the output - if you know the policy, schedule, schedule type, etc, it's helpful to avoid redundant output.  If you can isolate the exact backup via bpimagelist, that's even better - then you can add an end-date and effectively search that one backup.

Once you have the output, isolate the .SAF files into a text file.  You'll use this as the filelist input for bprestore.

bprestore -B -C <client> [the same search options you ended up using for bplist, except for the -R /] -L <log_file> -f <filelist>

to restore to an alternate client, add -D <client>.

Hope that helps

Bill

rookie11's picture

i ran sudo ./bplist -B -C name -t 0 -R 909 -k policyname -s 05/01/2013 01:00:00 /FS | grep SDOC*.SAF  

 

to list .SAF files but it didnt show any output. please point out my mistake.

bills's picture

Using a number with -R and specifying a filesystem instead of "/" has, in my experience, given unexpected results.  I recommend -R /.

Also, try it without the grep to see if you get an error.

Bill

watsons's picture

in addition to what bills suggested, don't use "-k policyname" and don't do a grep, just output everything to a file first. After that grep what you want into a filelist to be used by bprestore.

rookie11's picture

I ran

./bplist -B -C name -t 0 -R 909 -k policyname -s 05/01/2013 01:00:00 /FS >> /tmp/list

after this how to " grep what you want into a filelist to be used by bprestore."

 

Nicolai's picture

bplist terminate each output with a null byte. This byte serious interfere with the work of grep.

Try this command:

bplist -B -C  host.acme.com  -l -R  -s 05/01/2013 01:00:00  / |sed 's/\x0//g' |  grep -i -a -e  "\.saf$"

sed remove the null byte

grep -i perform case insensitive search

\.saf$ makes grep match at end of line

UNIX is case sensitive - /FS and /fs is not the same file system.

http://www.mass.dk/netbackup/quick-hints/88-remove-null-byte-from-bplist-output.html

http://www.mass.dk/netbackup/quick-hints/75-bplist-a-handy-tool-for-the-netbackup-admin.html

Assumption is the mother of all mess ups.

If this post answered your'e qustion -  Please mark as a soloution.

SOLUTION
Mark_Solutions's picture

You signature says 7.1 and earlier - is that still the case or have you upgraded to 7.5 ... and do you use OpsCenter?

If so you do a search on that clients backups for .SAF files and restore then all straight from OpsCenter - should be way easier from than from NBU if you have the facility

Hope this helps

Authorised Symantec Consultant

Don't forget to "Mark as Solution" if someones advice has solved your issue - and please bring back the Thumbs Up!!.

bills's picture

Just a warning - if you use -s 05/01/2013 01:00:00, and you've backed up the data several times since then, bplist will list each file once for each time it's been backed up.  If you use the same date search with bprestore, you will by default get the most recent backup restored, which may not be what you're looking for.

If you know you want to restore data from the backup that happened the night of 5/1, you should add an end date: -e 05/01/2013 08:00:00, or something similar.

Bill

rookie11's picture

error in bprestore:

sudo ./bprestore -B -C CLserver -D CLserver -t 0 -p test-CLserverFS -s 05/10/2013 06:00:00 -e 05/10/2013 14:00:00 -L /tmp/ppp -R /tmp/ren -f /tmp/list 

error: Invalid line length in line:

EXIT STATUS 144: invalid command usage

running it on master server. client n master both linux.

ren output:

change /TEMPFS/user to /global/test/endpoint                 cursor in next line.

/tmp/list contains files which are at location:

/TEMPFS/user/file1.txt

/TEMPFS/user/file2.txt

/TEMPFS/user/file3.txt

unable to find out where is error in command  ????????????????????????????

 

Nagalla's picture

even blank line in file /tmp/list  causes this error, make sure that there is no blank line in file /tmp/list 

 

bills's picture

Check for spaces at the end of the lines in the filelist?  Is that the entire list (3 lines), or is there more?  There's a note in the bprestore man page for how to specify filenames with spaces, if you have any of those:

 filepathlen filepath

The filepathlen is the total number of characters in the file path.

Was there anything in the log file?

Bill

rookie11's picture

Nagalla u were spot on. there was a blank line in the end on /tmp/list

but a big problem again. precisly i have to restore 39541 files, updated complete file list, total data size 30GB. After Nagalla, nicolai's help i started bprestore command but its taking really long time to restore files. it stays in queue state even after 5.5 hrs and still in queue  ?????????????????????????????

bills's picture

The restore process will be queued until it gathers all the info it needs regarding what to restore, then it will go to active..  I have seen this take hours, especially with large restore lists.

Bill

Nagalla's picture

yes, i have also expirenced the same kind of issue.. where i checked that status in next day...

sometimes i did find they never move furhter...

i would suggest you to splite the restore jobs multiple jobs and try one by one... that probably increase the manual task but you will find restore progress and get the  things done.

huanglao2002's picture

Can you try to understand the bprestore command.