tar exclude files code example
Example 1: tar exclude directory
$ tar --exclude='./folder' --exclude='./upload/folder2' -zcvf /backup/filename.tgz .
Example 2: tar archive all files in directory
cd ..
tar czf workspace.tar.gz workspace
$ tar --exclude='./folder' --exclude='./upload/folder2' -zcvf /backup/filename.tgz .
cd ..
tar czf workspace.tar.gz workspace