LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Excluding executables in a sub-directory from tar backups (https://www.linuxquestions.org/questions/linux-general-1/excluding-executables-in-a-sub-directory-from-tar-backups-822809/)

sorvad 07-29-2010 04:14 AM

Excluding executables in a sub-directory from tar backups
 
Just trying to set up a new backup using tar, but there are a few things I dont want to include. Using --exclude I can exclude sub-directories, but how do I exclude specific files in a subdirectory that are (for instance) executables or have a specific extension?

druuna 07-29-2010 04:18 AM

Hi,

Answered a similar question here at LQ a while back. Have a look here tar excluding some files

Hope this helps.

sorvad 07-29-2010 04:28 AM

Hi druuna - thats great, but only solves part of problem - any idea how I exclude files with executable permission in the sub-directory?

druuna 07-29-2010 04:42 AM

Hi,

You can create a file with executables like this: find /path/to/dir -type f -perm -u=x > exclude.list

Use this exclude list to feed tar.

Hope this helps.

sorvad 07-29-2010 05:59 AM

Thanks druuna

druuna 07-29-2010 06:04 AM

You're welcome :)


All times are GMT -5. The time now is 09:02 PM.