help-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-tar] tar list of dirs from STDIN - *just the dirs* (to save perms)


From: help-tar
Subject: [Help-tar] tar list of dirs from STDIN - *just the dirs* (to save perms)
Date: Tue, 28 Nov 2017 18:29:35 -0600

Goal: read list of dirs from STDIN, and archive only the dirs not the contents.
If the list is 5 dirs then the archive is exactly 5 dirs, with none of the 
contents in 
those dirs.

--
thanks,
Tom
--
Example that fails:

    $ tar --version
    tar (GNU tar) 1.29
    $ echo ~/.config/ | tar -cvf /dev/null -T - --no-recursion 2>&1 |head -4
    tar: Removing leading `/' from member names
    /a/myself/.config/
    /a/myself/.config/ranger/
    /a/myself/.config/ranger/history

>From 'info tar':

    Specifying '--no-recursion' is a way to tell 'tar' to grab only the 
directory
    entries given to it, adding no new files on its own.  To summarize, if
    you use 'find' to create a list of files to be stored in an archive, use
    it as follows:
         
         $ find DIR TESTS | \
           tar -cf ARCHIVE -T - --no-recursion



reply via email to

[Prev in Thread] Current Thread [Next in Thread]