Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 professional system and network administrators.

add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.