Quantcast

How do you exclude a directory that is a symlink?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How do you exclude a directory that is a symlink?

Steve Dondley
A thousand greetings,

I'm trying to rsync a directory from a server to my local machine that has a symbolic link to a directory I don't want to download. I have an "exclude" option to exclude the symlink which works fine. However, if I add a --copy-links option to the command, it appears to override my "exclude" directive and the contents of the symlinked directory gets downloaded anyway.

I suspect I need some kind of --filter option. I read the documentation (or at least tried do) regarding the --filter option but a mortal, casual user like me could not make heads or tails of it.

Thanks.

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How do you exclude a directory that is a symlink?

Paul Slootman-5
On Fri 03 Mar 2017, Steve Dondley wrote:

> I'm trying to rsync a directory from a server to my local machine that has
> a symbolic link to a directory I don't want to download. I have an
> "exclude" option to exclude the symlink which works fine. However, if I add
> a --copy-links option to the command, it appears to override my "exclude"
> directive and the contents of the symlinked directory gets downloaded
> anyway.

You don't say explicitly, is the target of the symlink inside or
outside the source directory?


Paul

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How do you exclude a directory that is a symlink?

Steve Dondley
The directory I'm trying to copy from is: /home/blah/dir

The symlink is /home/blah/dir/unwanted_symlinked_dir

On Fri, Mar 3, 2017 at 8:10 AM, Paul Slootman <[hidden email]> wrote:
On Fri 03 Mar 2017, Steve Dondley wrote:

> I'm trying to rsync a directory from a server to my local machine that has
> a symbolic link to a directory I don't want to download. I have an
> "exclude" option to exclude the symlink which works fine. However, if I add
> a --copy-links option to the command, it appears to override my "exclude"
> directive and the contents of the symlinked directory gets downloaded
> anyway.

You don't say explicitly, is the target of the symlink inside or
outside the source directory?


Paul



--
Prometheus Labor Communications, Inc.
http://prometheuslabor.com
<a href="tel:(413)%20572-1300" value="+14135721300" target="_blank">413-572-1300

Communicate or Die: American Labor Unions and the Internet
http://communicateordie.com

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How do you exclude a directory that is a symlink?

Paul Slootman-5
On Fri 03 Mar 2017, Steve Dondley wrote:

> The directory I'm trying to copy from is: /home/blah/dir
>
> The symlink is /home/blah/dir/unwanted_symlinked_dir
>
> On Fri, Mar 3, 2017 at 8:10 AM, Paul Slootman <[hidden email]> wrote:
>
> > You don't say explicitly, is the target of the symlink inside or
> > outside the source directory?

No, I was asking about the *target* of the symlink. Not the name of the
symlink itself.


Paul

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How do you exclude a directory that is a symlink?

Steve Dondley
Ah, sorry, it links to somewhere outside the directory. Thanks.

/home/blah/dir/unwanted_symlinked_dir points to /home/blah/other_dir

On Fri, Mar 3, 2017 at 10:03 AM, Paul Slootman <[hidden email]> wrote:
On Fri 03 Mar 2017, Steve Dondley wrote:

> The directory I'm trying to copy from is: /home/blah/dir
>
> The symlink is /home/blah/dir/unwanted_symlinked_dir
>
> On Fri, Mar 3, 2017 at 8:10 AM, Paul Slootman <[hidden email]> wrote:
>
> > You don't say explicitly, is the target of the symlink inside or
> > outside the source directory?

No, I was asking about the *target* of the symlink. Not the name of the
symlink itself.


Paul



--
Prometheus Labor Communications, Inc.
http://prometheuslabor.com
<a href="tel:(413)%20572-1300" value="+14135721300" target="_blank">413-572-1300

Communicate or Die: American Labor Unions and the Internet
http://communicateordie.com

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How do you exclude a directory that is a symlink?

Ken Chase
In reply to this post by Steve Dondley
Considering you cant INCLUDE a directory that is a symlink... which would
be really handy right now for me to resolve a mapping of 103 -> meaningful_name
for backups, instead im resorting to temporary bind mounts of 103 onto
meaningful_name, and when the bind mount isnt there, the --del is emptying
meaningful_name accidentally at times.

I think both situations could benefit from a --resolve-cmd-line-links switch
to resolve COMMAND LINE-SUPPLIED symlinks.

http://unix.stackexchange.com/questions/153262/get-rsync-to-dereference-symlinked-dirs-presented-on-cmdline-like-find-h

/kc


On Fri, Mar 03, 2017 at 07:41:10AM -0500, Steve Dondley said:
  >A thousand greetings,
  >
  >I'm trying to rsync a directory from a server to my local machine that has
  >a symbolic link to a directory I don't want to download. I have an
  >"exclude" option to exclude the symlink which works fine. However, if I add
  >a --copy-links option to the command, it appears to override my "exclude"
  >directive and the contents of the symlinked directory gets downloaded
  >anyway.
  >
  >I suspect I need some kind of --filter option. I read the documentation (or
  >at least tried do) regarding the --filter option but a mortal, casual user
  >like me could not make heads or tails of it.
  >
  >Thanks.

  >--
  >Please use reply-all for most replies to avoid omitting the mailing list.
  >To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
  >Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


--
Ken Chase - [hidden email] skype:kenchase23 +1 416 897 6284 Toronto Canada
Heavy Computing - Clued bandwidth, colocation and managed linux VPS @151 Front St. W.

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How do you exclude a directory that is a symlink?

Steve Dondley
I'm not sure if this is directed at me or not. But should I take it to mean that what I want to accomplish is not possible using normal commands?

On Fri, Mar 3, 2017 at 10:48 AM, Ken Chase <[hidden email]> wrote:
Considering you cant INCLUDE a directory that is a symlink... which would
be really handy right now for me to resolve a mapping of 103 -> meaningful_name
for backups, instead im resorting to temporary bind mounts of 103 onto
meaningful_name, and when the bind mount isnt there, the --del is emptying
meaningful_name accidentally at times.

I think both situations could benefit from a --resolve-cmd-line-links switch
to resolve COMMAND LINE-SUPPLIED symlinks.

http://unix.stackexchange.com/questions/153262/get-rsync-to-dereference-symlinked-dirs-presented-on-cmdline-like-find-h

/kc


On Fri, Mar 03, 2017 at 07:41:10AM -0500, Steve Dondley said:
  >A thousand greetings,
  >
  >I'm trying to rsync a directory from a server to my local machine that has
  >a symbolic link to a directory I don't want to download. I have an
  >"exclude" option to exclude the symlink which works fine. However, if I add
  >a --copy-links option to the command, it appears to override my "exclude"
  >directive and the contents of the symlinked directory gets downloaded
  >anyway.
  >
  >I suspect I need some kind of --filter option. I read the documentation (or
  >at least tried do) regarding the --filter option but a mortal, casual user
  >like me could not make heads or tails of it.
  >
  >Thanks.

  >--
  >Please use reply-all for most replies to avoid omitting the mailing list.
  >To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
  >Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


--
Ken Chase - [hidden email] skype:kenchase23 <a href="tel:%2B1%20416%20897%206284" value="+14168976284">+1 416 897 6284 Toronto Canada
Heavy Computing - Clued bandwidth, colocation and managed linux VPS @151 Front St. W.

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html



--
Prometheus Labor Communications, Inc.
http://prometheuslabor.com
413-572-1300

Communicate or Die: American Labor Unions and the Internet
http://communicateordie.com

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How do you exclude a directory that is a symlink?

Wayne Davison-2
In reply to this post by Steve Dondley
On Fri, Mar 3, 2017 at 4:41 AM, Steve Dondley <[hidden email]> wrote:
However, if I add a --copy-links option to the command, it appears to override my "exclude" directive and the contents of the symlinked directory gets downloaded anyway.

The use of --copy-links doesn't do that, so mention what your args and paths are and we can figure out what you're seeing.

..wayne..

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How do you exclude a directory that is a symlink?

Wayne Davison-2
In reply to this post by Ken Chase
On Fri, Mar 3, 2017 at 7:48 AM, Ken Chase <[hidden email]> wrote:
I think both situations could benefit from a --resolve-cmd-line-links switch to resolve COMMAND LINE-SUPPLIED symlinks.

You can specify symlinks in a --relative path with a trailing slash-dot (and use /./ infix notation to trim paths). For example:

rsync -aivR /some/path/./symlink/. /dest/

That will create /dest/symlink/ and its contents.

..wayne..

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Loading...