

Incremental tar and directory exclusion - tar incremental backup exclude directory compression
With this command we are going to create a tar archive (--file=home.tar.xz) compressed using XZ (-J):
tar -v --create -J --file=home.tar.xz -g /home/user/.usr.snar --exclude={"/home/user/documents/images","/home/snake/documents/school/astab"} /home/user/documents/
The -g option tells tar to create an incremental backup. The information used for the incremental backup are stored in /home/user/.usr.snar.
We exclude from the archive two directories, "images" and "astab".