[aklug] Re: tar -X directory listing syntax

From: Mike <barjunk@attglobal.net>
Date: Sat Dec 07 2013 - 13:00:31 AKST

Quoting Tim Johnson <tim@akwebsoft.com>:

> Hi :
>
> I'm feeding options to tar via drush, which is a command-line
> utility for drupal. Tar code which works standalone with certain
> options such as -X (which use an input file) doesn't work correctly.
>
> The directory in questions has dozens of subdirectories on which I
> want only 7 plus all files at the root.
>
> I want to try using the tar `include' option which would do the
> following
>
> 1)tar the following _subdirectories_ and everything subsequent
> (below)
>
> includes, misc, modules, profiles, scripts, sites, themes
>
> those need to be explicit names, not patterns. I don't want tar to
> pick up something like `myprofiles' or `perl_scripts'.
>
> 2)tar all _files_ in the root of the target directory
>
> Any working ideas welcome. Remember input files such as used for -T
> and -X don't seem to work.
>

Tim,

This has been a problem that has plagued TAR from the beginning as far
as I know. Most of the things say that you should put file names in
the -T file and not directories, although it is implied that you could
use directories.

Also, you could use find to create the -T file, being careful of
absolute references (including the leading/).

Searching around the tests of the source I found this:

http://git.savannah.gnu.org/cgit/tar.git/tree/tests/T-cd.at?id=49f3145092b00de0b21bd0b751b6caaa57db4fc4

The implication here is that you add -C <directory to backup> and the
. reference to have it backup all the files in the directory.

Given the version of tar you are using, it is possible that placement
of the -T option may impact how this works, so keep that in mind.

You should note, the above test is for 1.27.1. It looks like the
earliest version that uses -C is within the -T option is 1.26.

It would be great to know what you end up finding out.

Mike B.
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sat Dec 7 13:00:56 2013

This archive was generated by hypermail 2.1.8 : Sat Dec 07 2013 - 13:00:56 AKST