On Tue, Sep 5, 2023 at 5:28 PM Walter Dnes <waltd...@waltdnes.org> wrote:
> Every so often I tar up my home directory on my main machine, and push > it over to my "hot backup" machine, and then do a tap-dance with the > .ssh directory. I notice oodles of cache files being tarred. Do I > understand the man page correctly about the CACHEDIR.TAG "magic file"? > Assume I have a .cache directory like so... > > [x8940][waltdnes][~] ll .cache > total 64 > drwx------ 12 waltdnes users 4096 Sep 5 10:50 . > drwxr-xr-x 141 waltdnes users 20480 Sep 5 10:58 .. > -rw-r--r-- 1 waltdnes users 0 Sep 5 10:50 CACHEDIR.TAG > drwx------ 2 waltdnes users 4096 Aug 29 15:34 babl > drwxr-xr-x 2 waltdnes users 4096 Sep 5 08:52 fontconfig > drwxr-xr-x 3 waltdnes users 4096 Jun 11 2021 geeqie > drwx------ 3 waltdnes users 4096 May 29 2021 gegl-0.4 > drwxr-xr-x 3 waltdnes users 4096 May 29 2021 gimp > drwx------ 3 waltdnes users 4096 May 27 2021 google-chrome > drwx------ 2 waltdnes users 4096 Sep 5 10:23 mc > drwxr-xr-x 258 waltdnes users 4096 Mar 24 2022 mesa_shader_cache > drwx------ 3 waltdnes users 4096 May 25 2021 'moonchild productions' > drwx------ 3 waltdnes users 4096 Nov 16 2021 thumbnails > > Would a script in /home like... > > #!/bin/bash > tar --exclude-caches-under cvzf wdexport.tgz waltdnes > > ...skip files in that directory? I don't mind a few empty directories. > Try it and see. My concern is that the man page implies that with --exclude-caches-under the subdirectories are excluded recursively, but the directory with the file called CACHEDIR.TAG is not. I'm sure that's wrong but the man page says what it says. -- Alan McKinnon alan dot mckinnon at gmail dot com