Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

scp ignore symlinks

1,301 views
Skip to first unread message

J.M.Roth

unread,
Nov 30, 2002, 5:11:39 AM11/30/02
to
Hi there,
I'd like to copy symlinks as such using scp. I don't want it to copy
symlinked directories.
What should I do?
Thanks.


all mail refused

unread,
Nov 30, 2002, 7:44:16 AM11/30/02
to

Something like:

tar cBf - . | ssh somehost 'cd my/dir && tar xvBof -'

--
decoy mail addresses: obtain username via 0x4f/tcp or 0x50/tcp
random words follow - don't take too seriously!
Call records allow traffic analysis but do not have the sole purpose
of People For Internet Responsibility (PFIR) "Statement on Internet
issues -- nobody does.

Alan J. Flavell

unread,
Nov 30, 2002, 7:36:50 AM11/30/02
to
On Nov 30, J.M.Roth inscribed on the eternal scroll:

> I'd like to copy symlinks as such using scp. I don't want it to copy
> symlinked directories.

Piping a "tar -cf - ..." into ssh running a remote
"(cd whatever; tar -xf -)" , using appropriate flags on
tar, can produce a useful range of desired behaviours.

Of course, in general the target of a symlink on one system might not
exist at all on another, so this only works in situations where it
makes sense.


Nico Kadel-Garcia

unread,
Nov 30, 2002, 9:17:38 AM11/30/02
to

"all mail refused" <el...@notatla.demon.co.uk> wrote in message
news:slrnauhcs7...@notatla.demon.co.uk...

> In article <3de88edb$1...@news.vo.lu>, J.M.Roth wrote:
> >Hi there,
> >I'd like to copy symlinks as such using scp. I don't want it to copy
> >symlinked directories.
> >What should I do?
>
> Something like:
>
> tar cBf - . | ssh somehost 'cd my/dir && tar xvBof -'

Be a bit more efficient about it.

rsync -e ssh -a sourcedir/ username@remotehost:targetdir/

This doesn't send duplicates of files already present. The disadvantage is
that it won't create the leading subdirectories that the tar would, but scp
wouldn't do that either.

And folks? Try this for the tar command, so there's no need to do the "cd".

tar cf - | ssh username@remotehost "tar xvf - -C my/dir"

And why were you using the B and o options above? From experience, they're
really not necessary.


0 new messages