scp and symlinks

Walter Dnes waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Mon Aug 16 00:58:57 UTC 2004


  Now that I'm back on broadband, I've downloaded the CRUX linux ISO,
and am setting up my second machine, and moving over a bunch of stuff to
it.  I prefer to use scp, but tar seems to be necessary to avoid certain
problems.  E.g. my music collection is in different directories by
genre.  I also want to sort it by year.  To avoid duplication, I use
symlinks.  That's fine until I try transferring to the second machine.
Assuming that directory misc/ exists on the 2nd machine...

scp -r misc/music waltdnes at machine2:misc/

...works.  But misc/music/year/19??, which contain symlinks on the
source machine end up containing actual files on the target machine.
I blew away misc/music/ on the target machine and pushed over that
one directory with...

tar  -cvf - music/year/ | ssh waltdnes at machine2 'tar -C misc -xvf -'

...which is uglier, but at least the symlinks came out as symlinks.  If
I had used this format originally, I could've pushed over the entire
music directory properly in the first place.  Is there a way to do it in
scp that I've overlooked?

-- 
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org>
Email users are divided into two classes;
1) Those who have effective spam-blocking
2) Those who wish they did
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list