cancel
Showing results for 
Search instead for 
Did you mean: 

Linux command line restore question

tboyer
Level 2

We have a need to script a file restore, and I'm having difficulty figuring out how the wildcards work in NetBackup.

This will work:

root@desktop bin)# ./bplist -l -PI -R  *1000000*
-rw-r--r-- root   root           601 Jul 02 03:59
- /tmp/app/TempFl/TempFl-2010-07-01/ndx_file_1000000_.idx 
-rw-r--r-- root   root           601 Jul 02 03:59
- /tmp/app/TempFl/TempFl-2010-07-01/ndx_file_1000000_.idx 

... (lots of files snipped)

but getting any more specific fails:

(PROD-BOYERS|root@desktop bin)# ./bplist -l -PI -R /tmp/app/TempFl/*1000000*  
EXIT STATUS 227: no entity was found

root@desktop bin)# ./bplist -l -PI -R  *TempFl/*1000000*
EXIT STATUS 227: no entity was found

root@desktop bin)# ./bplist -l -PI -R  *TempFl*1000000*
EXIT STATUS 227: no entity was found


Can't find anything in the docs, but I must be missing something obvious.  Any help apprciated - thanks much!

-- tim --

1 ACCEPTED SOLUTION

Accepted Solutions

Will_Restore
Level 6
http://seer.entsupport.symantec.com/docs/275578.htm

For UNIX clients:
Suppose the following list of files exist on the client:
/usr/tech/mynotes/MEDIA_MANAGER/drivecleaning_examples.txt
/usr/tech/mynotes/MEDIA_MANAGER/drivecleaning_notes.txt
/usr/tech/mynotes/MEDIA_MANAGER/drivecleaning_notes.old.txt
/usr/tech/mynotes/MEDIA_MANAGER/drivecleaning_technote.txt
/usr/tech/mynotes/MEDIA_MANAGER/to_disable_drive_cleaning.txt
 
The following file list on a policy will result in a backup of all five files.
/usr/tech/mynotes/MEDIA_MANAGER/*lean*
 
The following file list will also work.            
/usr/*/*/*/*lean*
 
Note:  One wildcard is needed for each directory level. For example:  /usr/*/*lean*  will not result in a backup of /usr/tech/mynotes/MEDIA_MANAGER/clean.txt. It will back up /usr/tech/clean.txt if it exists.

View solution in original post

5 REPLIES 5

Will_Restore
Level 6

has different number of subdirectories than the full path (as do your other examples) 

/tmp/app/TempFl/TempFl-2010-07-01/ndx_file_1000000_.idx 

you'd have to specify

/tmp/app/TempFl/TempFl-2010-07-01/*1000000* 

or perhaps

/tmp/app/*/*/*1000000* 

to get a match

Will_Restore
Level 6
http://seer.entsupport.symantec.com/docs/275578.htm

For UNIX clients:
Suppose the following list of files exist on the client:
/usr/tech/mynotes/MEDIA_MANAGER/drivecleaning_examples.txt
/usr/tech/mynotes/MEDIA_MANAGER/drivecleaning_notes.txt
/usr/tech/mynotes/MEDIA_MANAGER/drivecleaning_notes.old.txt
/usr/tech/mynotes/MEDIA_MANAGER/drivecleaning_technote.txt
/usr/tech/mynotes/MEDIA_MANAGER/to_disable_drive_cleaning.txt
 
The following file list on a policy will result in a backup of all five files.
/usr/tech/mynotes/MEDIA_MANAGER/*lean*
 
The following file list will also work.            
/usr/*/*/*/*lean*
 
Note:  One wildcard is needed for each directory level. For example:  /usr/*/*lean*  will not result in a backup of /usr/tech/mynotes/MEDIA_MANAGER/clean.txt. It will back up /usr/tech/clean.txt if it exists.

Ed_Wilts
Level 6

My simple way to do this quickly is to pipe the output to grep:

Instead of:
# ./bplist -l -PI -R  *1000000*

Use:
# ./bplist -l -PI -R  | grep 1000000

This works around the problem of the shell doing its own expansion.

tboyer
Level 2

Aha!  That's the magic phrase:

"Note:  One wildcard is needed for each directory level"

Thanks much...

tboyer
Level 2

Aha!  That's the magic phrase:

"Note:  One wildcard is needed for each directory level"

Thanks much...