Hello,
I am trying to exclude the .cache directories when I tar a home directory by using: tar -cjf /mnt/backup/home.tbz2 --exclude-caches-all /home/pdupre but it does not work. What am I doing wrong ?
Thank for your help.
=========================================================================== Patrick DUPRÉ | | email: pdupre@gmx.com Laboratoire de Physico-Chimie de l'Atmosphère | | Université du Littoral-Côte d'Opale | | Tel. (33)-(0)3 28 23 76 12 | | Fax: 03 28 65 82 44 189A, avenue Maurice Schumann | | 59140 Dunkerque, France ===========================================================================
On Mon, 2015-12-21 at 21:29 +0100, Patrick Dupre wrote:
Hello,
I am trying to exclude the .cache directories when I tar a home directory by using: tar -cjf /mnt/backup/home.tbz2 --exclude-caches-all /home/pdupre but it does not work. What am I doing wrong ?
Do the .cache dirs each have a file called CACHEDIR.TAG with just the below line?
Signature: 8a477f597d28d172789f06886806bc55
I don't remember learning about this tar feature but checking the man page of tar I found the name of that tag file and a test found the file to not be enough but a web search came up with the idea that they need that signature and adding that line to my tag file caused my tar to act as expected.
Thank you
=========================================================================== Patrick DUPRÉ | | email: pdupre@gmx.com Laboratoire de Physico-Chimie de l'Atmosphère | | Université du Littoral-Côte d'Opale | | Tel. (33)-(0)3 28 23 76 12 | | Fax: 03 28 65 82 44 189A, avenue Maurice Schumann | | 59140 Dunkerque, France ===========================================================================
Sent: Monday, December 21, 2015 at 9:50 PM From: "Doug H." fedoraproject.org@wombatz.com To: users@lists.fedoraproject.org Subject: Re: tar exclude cache
On Mon, 2015-12-21 at 21:29 +0100, Patrick Dupre wrote:
Hello,
I am trying to exclude the .cache directories when I tar a home directory by using: tar -cjf /mnt/backup/home.tbz2 --exclude-caches-all /home/pdupre but it does not work. What am I doing wrong ?
Do the .cache dirs each have a file called CACHEDIR.TAG with just the below line?
Signature: 8a477f597d28d172789f06886806bc55
I don't remember learning about this tar feature but checking the man page of tar I found the name of that tag file and a test found the file to not be enough but a web search came up with the idea that they need that signature and adding that line to my tag file caused my tar to act as expected.
-- Doug H. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
On 12/21/2015 02:41 PM, Patrick Dupre wrote:
Thank you
By the way, the signature is the MD5 hash of the string ".IsCacheDirectory" and it's SPECIFICALLY looked for by tar:
[root@prophead tmp]# strings /bin/tar | grep 8a477f597d28d172789f06886806bc55 Signature: 8a477f597d28d172789f06886806bc55
They don't mention the need for the signature in the man page, but it IS buried in the "info" pages (under section 6.4):
<quote> When creating an archive, the '--exclude-caches' option family causes 'tar' to exclude all directories that contain a "cache directory tag". A cache directory tag is a short file with the well-known name 'CACHEDIR.TAG' and having a standard header specified in http://www.brynosaurus.com/cachedir/spec.html. Various applications write cache directory tags into directories they use to hold regenerable, non-precious data, so that such data can be more easily excluded from backups.
There are three 'exclude-caches' options, each providing a different exclusion semantics:
'--exclude-caches' Do not archive the contents of the directory, but archive the directory itself and the 'CACHEDIR.TAG' file.
'--exclude-caches-under' Do not archive the contents of the directory, nor the 'CACHEDIR.TAG' file, archive only the directory itself.
'--exclude-caches-all' Omit directories containing 'CACHEDIR.TAG' file entirely. </quote>
And the spec mentioned was written in...2004! Jeeze! I don't think they could have buried this information deeper if they tried. I knew about it, but it's pretty damned silly to not put it in the man page since not everyone installs info and its database. And even with info, the signature itself is NOT defined except in the webpage cited. What if they decide to take that site offline because the author doesn't wish to keep it up?
I'm sending a copy of this note to bug-tar@gnu.org. Perhaps they'll update their docs.
Sent: Monday, December 21, 2015 at 9:50 PM From: "Doug H." fedoraproject.org@wombatz.com To: users@lists.fedoraproject.org Subject: Re: tar exclude cache
On Mon, 2015-12-21 at 21:29 +0100, Patrick Dupre wrote:
Hello,
I am trying to exclude the .cache directories when I tar a home directory by using: tar -cjf /mnt/backup/home.tbz2 --exclude-caches-all /home/pdupre but it does not work. What am I doing wrong ?
Do the .cache dirs each have a file called CACHEDIR.TAG with just the below line?
Signature: 8a477f597d28d172789f06886806bc55
I don't remember learning about this tar feature but checking the man page of tar I found the name of that tag file and a test found the file to not be enough but a web search came up with the idea that they need that signature and adding that line to my tag file caused my tar to act as expected.
-- Doug H. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
On Mon, 2015-12-21 at 16:19 -0800, Rick Stevens wrote:
On 12/21/2015 02:41 PM, Patrick Dupre wrote:
Thank you
By the way, the signature is the MD5 hash of the string ".IsCacheDirectory" and it's SPECIFICALLY looked for by tar:
[snip of great info]
As a bonus question; do you know why md5sum is showing a different value, as in...
echo ".IsCacheDirectory" | md5sum -
6929f806dd11bc634be8205d11af24d6 -
I used "John the Ripper" to prove that 8a477f597d28d172789f06886806bc55 really *is* the hash of .IsCacheDirectory but I am not clear on what md5sum is giving me.
On 12/21/2015 05:37 PM, Doug H. wrote:
On Mon, 2015-12-21 at 16:19 -0800, Rick Stevens wrote:
On 12/21/2015 02:41 PM, Patrick Dupre wrote:
Thank you
By the way, the signature is the MD5 hash of the string ".IsCacheDirectory" and it's SPECIFICALLY looked for by tar:
[snip of great info]
As a bonus question; do you know why md5sum is showing a different value, as in...
echo ".IsCacheDirectory" | md5sum -
6929f806dd11bc634be8205d11af24d6 -
I used "John the Ripper" to prove that 8a477f597d28d172789f06886806bc55 really *is* the hash of .IsCacheDirectory but I am not clear on what md5sum is giving me.
Has to do with end-of-line stuff. Try:
[root@prophead tmp]# printf "%s" ".IsCacheDirectory" | md5sum 8a477f597d28d172789f06886806bc55 -
(the "-" at the end is md5sum telling me that it was looking at stdin). ---------------------------------------------------------------------- - Rick Stevens, Systems Engineer, AllDigital ricks@alldigital.com - - AIM/Skype: therps2 ICQ: 226437340 Yahoo: origrps2 - - - - Make it idiot proof and someone will make a better idiot. - ----------------------------------------------------------------------
On 12/21/2015 06:11 PM, Rick Stevens wrote:
On 12/21/2015 05:37 PM, Doug H. wrote:
On Mon, 2015-12-21 at 16:19 -0800, Rick Stevens wrote:
On 12/21/2015 02:41 PM, Patrick Dupre wrote:
Thank you
By the way, the signature is the MD5 hash of the string ".IsCacheDirectory" and it's SPECIFICALLY looked for by tar:
[snip of great info]
As a bonus question; do you know why md5sum is showing a different value, as in...
echo ".IsCacheDirectory" | md5sum -
6929f806dd11bc634be8205d11af24d6 -
I used "John the Ripper" to prove that 8a477f597d28d172789f06886806bc55 really *is* the hash of .IsCacheDirectory but I am not clear on what md5sum is giving me.
Has to do with end-of-line stuff. Try:
[root@prophead tmp]# printf "%s" ".IsCacheDirectory" | md5sum 8a477f597d28d172789f06886806bc55 -(the "-" at the end is md5sum telling me that it was looking at stdin).
Additional: [root@prophead tmp]# echo -n ".IsCacheDirectory" | md5sum 8a477f597d28d172789f06886806bc55 -
("echo -n" means "don't include the newline")
---------------------------------------------------------------------- - Rick Stevens, Systems Engineer, AllDigital ricks@alldigital.com - - AIM/Skype: therps2 ICQ: 226437340 Yahoo: origrps2 - - - - I haven't lost my mind. It's backed up on tape somewhere, but - - probably not recoverable. - ----------------------------------------------------------------------