FAQ
Hi all,

I have a need to copy only dirs, subdirs and sym links only without
the need to copy contents.

I originally used the following test to observe behavior;

rsync -a -f"+ */" -f"- *" source destination

So I noticed that dirs/subdirs were copied but without contents as
desired.

I have several sym links (dir sym links) that I would also to to copy
over.

I tried this;

rsync -a -f"+ */" -f"- * -l" source destination

Although my sym links show, they are broken.

Any thoughts on how to copy dirs, subdirs and sym links only w/o
contents?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.centos.org/pipermail/centos/attachments/20100516/1f782111/attachment.html

Search Discussions

  • John Doe at May 17, 2010 at 2:45 pm
    From: "aurfalien at gmail.com" <aurfalien at gmail.com>
    Any thoughts on how to copy dirs, subdirs and sym links only w/o contents?
    Not sure what you mean by broken but, did you check -k or -K?
    Maybe if you give an example...

    JD
  • Aurfalien at May 17, 2010 at 3:01 pm

    On May 17, 2010, at 7:45 AM, John Doe wrote:

    From: "aurfalien at gmail.com" <aurfalien at gmail.com>
    Any thoughts on how to copy dirs, subdirs and sym links only w/o
    contents?
    Not sure what you mean by broken but, did you check -k or -K?
    Maybe if you give an example...

    JD
    Upon looking at them again, they are intact.

    However the contents or file data does get copied over when using the -
    l flag.
  • Thiago at May 17, 2010 at 9:19 pm
    You can try this option!!!
    *-d, --dirs* Tell the sending side to include any directories that are
    encountered. Unlike *--recursive*, a directory's contents are not copied
    unless the directory name specified is "." or ends with a trailing slash
    (e.g. ".", "dir/.", "dir/", etc.). Without this option or the
    *--recursive*option, rsync will skip all directories it encounters
    (and output a message
    to that effect for each one). If you specify both *--dirs* and *--recursive*,
    *--recursive* takes precedence.

    The *--dirs* option is implied by the *--files-from* option or the *
    --list-only* option (including an implied *--list-only* usage) if *
    --recursive* wasn't specified (so that directories are seen in the listing).
    Specify *--no-dirs* (or *--no-d*) if you want to turn this off.

    There is also a backward-compatibility helper option, *--old-dirs* (or *
    --old-d*) that tells rsync to use a hack of "-r --exclude='/*/*'" to get an
    older rsync to list a single directory without recursing.

    On Mon, May 17, 2010 at 12:01 PM, wrote:
    On May 17, 2010, at 7:45 AM, John Doe wrote:

    From: "aurfalien at gmail.com" <aurfalien at gmail.com>
    Any thoughts on how to copy dirs, subdirs and sym links only w/o
    contents?
    Not sure what you mean by broken but, did you check -k or -K?
    Maybe if you give an example...

    JD
    Upon looking at them again, they are intact.

    However the contents or file data does get copied over when using the -
    l flag.
    _______________________________________________
    CentOS mailing list
    CentOS at centos.org
    http://lists.centos.org/mailman/listinfo/centos
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.centos.org/pipermail/centos/attachments/20100517/dd5eaa5f/attachment.html

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos @
categoriescentos
postedMay 17, '10 at 1:06a
activeMay 17, '10 at 9:19p
posts4
users3
websitecentos.org
irc#centos

3 users in discussion

Aurfalien: 2 posts Thiago: 1 post John Doe: 1 post

People

Translate

site design / logo © 2021 Grokbase