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.
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: