Forum Discussion

AndrewPilgrim's avatar
8 years ago

Unix Client Exclude particular file extension from all subdirectories

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.

 

  • "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.

11 Replies

  • "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.

    • AndrewPilgrim's avatar
      AndrewPilgrim
      Level 4

      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 :smileysad:

      • Marianne2's avatar
        Marianne2
        Level 4

        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. 

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

    • AndrewPilgrim's avatar
      AndrewPilgrim
      Level 4

      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.

       

      • Will_Restore's avatar
        Will_Restore
        Level 6

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

        (no wildcards needed)

         

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

  • 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.

    • Arkya's avatar
      Arkya
      Level 4

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