I would like to make a cronjob who makes a tag.gz of everything inside a directory in a recursive way. BUT there is a HUGE directory full of jpg's. I don't want this one in the backup.
Additional points if it can backup symbolic links.
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
|
|
Simple - you use tar's --exclude flag:
That will exclude *.jpg, *.jpG, *.jPg, *.jPG, *.Jpg, *.JpG, *.JPg and *.JPG You can specify multiple --exclude flags if you want to exclude more things. |
|||
|
|
|
You could use the exclude pattern option of tar in the following way: Assuming you want to backup a dir called foo and exclude foo/bar, you would do:
|
|||
|