You are not logged in.

#1 2014-10-20 00:28:20

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

TAR question regarding directory exclusions

I am trying to get tar to archive my home directory, excluding specific cache directories and it is failing to exclude as I expect.

Here is my command line, which starts archiving fine:

tar cvJf archive.tar.xz . -X /home/larry/scripts/exclude.txt

This is the exclude text file:

./.cache/
./Downloads/
./.wine/
./.thumbnails/
./.config/chromium/

It does not exclude the above directories and their files. What am I doing wrong?


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#2 2014-10-20 01:23:36

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: TAR question regarding directory exclusions

You're missing a wildcard from the end of each line: ./.cache/*, ./.wine/*, etc.

Offline

#3 2014-10-20 02:17:26

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: TAR question regarding directory exclusions

Doh. That was easy - thanks!


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

Board footer

Powered by FluxBB