extract in a folder tar code example
Example 1: tar exclude directory
$ tar --exclude='./folder' --exclude='./upload/folder2' -zcvf /backup/filename.tgz .
Example 2: extract tar
tar -xvf file.tar
$ tar --exclude='./folder' --exclude='./upload/folder2' -zcvf /backup/filename.tgz .
tar -xvf file.tar