Mailinglist Archive: opensuse (3831 mails)

< Previous Next >
Re: [opensuse] scp and links
  • From: "Andy Harrison" <aharrison@xxxxxxxxx>
  • Date: Wed, 10 Jan 2007 09:48:12 -0500
  • Message-id: <a22ff2940701100648p3918053v5ebf11e4c047fad3@xxxxxxxxxxxxxx>
On 1/10/07, Herbert Georg <hcgeorg@xxxxxxxxx> wrote:
By default, when scp copies links from a machine to another, it
transfers the actual file instead.
How can I make scp to create the corresponding link in the destination
machine, instead of copying the file, and increasing the occupied space
in disk?


Alternatively, you can tunnel tar through ssh. I keep it in a script
and call it sshtar. It copies files from a remote directory into the
current directory.


#!/bin/sh
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
printf "\n\n\tExample:\n\n\t\tsshtar username hostname_or_ip /dir/to/copy\n\n"
exit 0
fi
/usr/bin/ssh $1@$2 "cd $3 ; tar cf - ." | tar xvfBp -

--
Andy Harrison
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References