cancel
Showing results for 
Search instead for 
Did you mean: 

Unix Client Exclude particular file extension from all subdirectories

AndrewPilgrim
Level 4
Partner

Hi

I am trying to get an exclude list put onto all our Unix Clients and having issues with one particular exclusion. I need to exclude all the .bash_history files that could reside in all the sub-directories below specific top level directories. 

Note: I cannot just put in .bash_history into the exclude list as we need to back it up for some users.

Example:

Say i had this particular file listed as follows in the directory structure for /u01

/u01/testdir1/.bash_history

/u01/testdir1/testdir2/testdir3/.bash_history

How could i put that into the exclude list so it would check all sub-directories of /u01 for that file and exclude it? Is it even possible as all the tests i have done dont work. No matter what i do it backs up this file every time.

Any advice would be appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions

watsons
Level 6

"Note: I cannot just put in .bash_history into the exclude list as we need to back it up for some users."

Actually I think you can put .bash_history into exclude_list , in this case.

For those you need to back it up for some users, just create another include_list file to tell NBU to backup. 

NBU looks at exclude_list first to exclude everything, but will look at include_list also (if that exists) to backup whatever it's there.

View solution in original post

11 REPLIES 11

Michael_G_Ander
Level 6
Certified

Think you still can do something like /u01/*/.bash_history in the Unix exclude_list file

The standard questions: Have you checked: 1) What has changed. 2) The manual 3) If there are any tech notes or VOX posts regarding the issue

BTLOMS
Level 5

You want to backup the sub folder for some users, but exclude it for others?

@Michael_G_AnderMichael

I had tried using /u01/*/.bash_history but it did not appear to work. I did another test and had create a file called /u01/test1/.bash_history and using the syntax /u01/*/.bash_history it still got backed up.

Had a look at the Admin Guide for Unix and Linux and didnt see anything in there or any use, neither have a found anything on the community/technote pages.

I'll keep playing..

@BTLOMS

Yeah so i want to be able to exclude a particular file from within the specific directory structure. So /u01 is the top level directory and i want to be able to exlcude .bash_history from any sub-directory of /u01 no matter if it is on the 2nd level or 5th level sub-directory.

 

Create a separate policy to backup /u01 and exclude .bash_history

(no wildcards needed)

 

Have you created bpbkar log folder on the client?
The log will tell us if exclude_list is read and how the contents is interpreted.

Can you please try to update the exclude list as /u01/*/*.bash_history if its under /u01/* the .bash_history file should get exluded.Please restart the netbackup client once before taking backup.

AndrewPilgrim
Level 4
Partner

@Will_Restore

Yeah guess i could do that. Trying to avoid it though if at all possible simply because i believe this should be possible. But might have to resort to this.

@Marianne2

I had not enable any logging other than whats on a default. I'll go read up on how to do this because Netbackup is not really 'my thing'. I am doing this work because i can access all the Unix servers, not because of my Netbackup knowledge. Good job as that is not that much :)

@Arkya

I tried what you suggested by stopping/starting the client but made no difference. Still backing up the files.

Thats weird,just thinking if there anything different with excluding hidden files.

watsons
Level 6

"Note: I cannot just put in .bash_history into the exclude list as we need to back it up for some users."

Actually I think you can put .bash_history into exclude_list , in this case.

For those you need to back it up for some users, just create another include_list file to tell NBU to backup. 

NBU looks at exclude_list first to exclude everything, but will look at include_list also (if that exists) to backup whatever it's there.

Yeah i guess i could do this.

Was hoping you could put in a single entry to exclude a particular file in a particular directroy and its sub-directories without then having to create a load of include rules for specific users we want the file backed up for Smiley Sad

If the file exists in multiple directory levels, you will need multiple entries in exclude_list:

/u01/*/.bash_history
/u01/*/*/.bash_history
/u01/*/*/*/.bash_history

You say: ".... all the tests i have done dont work."

Please show us examples of what you have tried. And please remember to create bpbkar log folder under /usr/openv/netbackup/logs on the client to see how the exclude_list is interpreted. 
Increase logging level for the client to 1 to see enumeration of files in bpbkar log.