Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Noob alert:

Can I exclude files in the directory "imagecache" but still make the directory a part of the TAR archive?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Certainly, just use --exclude for that purpose.

tar czf file.tar.gz --exclude '*/imagecache/*' files-or-directories-to-add

man tar

share|improve this answer
    
Just to be sure, will there still be the a empty directory called "imagecache" in the archive? –  Cudos Mar 17 '11 at 18:34
    
Yes, I've used this command yesterday. I've just tested this command, and it still works. –  Lekensteyn Mar 17 '11 at 18:35

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.