Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have a directory structure with files like

/files/pics/gal1/1.jpg
/files/pics/gal1/thumbs/1.jpg
/files/pics/gal1/full/1.jpg

(with 1000's of files. gal1 and 1.jpg obviously change)

all i want to back up are everything apart from the ones in /full/. so basically, i need to backup:

/files/pics*

but exclude

/files/pics/*/full/*

how can i write a .tar.gz to do this?

thank you

share|improve this question

migrated from serverfault.com Jul 10 '10 at 0:08

This question came from our site for system and network administrators.

From the directory containing the files directory:

tar -zcf files.tgz files --exclude="files/pics/*/full"
share|improve this answer
    
Maybe: tar -zcf files.tgz files/pic/gal1 --exclude="files/pics/*/full" to match OP's requirement – jim mcnamara Jul 12 '10 at 16:42

You must log in to answer this question.