Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS (http://www.linux-archive.org/centos/)
-   -   scp copy remote files does NOT copy link? (http://www.linux-archive.org/centos/298825-scp-copy-remote-files-does-not-copy-link.html)

mcclnx mcc 12-21-2009 05:38 PM

scp copy remote files does NOT copy link?
 
We have CENTOS 5.3 on DELL servers. I tried to us following command to copy remote files system to local:

scp -rp oracle@ORA2:/home/app/oracle/10.2 .

After SCP finish copy, I found some files on source file system using "link" but on target file systems it change to "physical file".

Does there has way scp not change "link" setup?

Thanks.

__________________________________________________ _
您的生活即時通 - 溝通、娛樂、生活、工作一次搞定!
http://messenger.yahoo.com.tw/
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Benjamin Franz 12-21-2009 05:46 PM

scp copy remote files does NOT copy link?
 
mcclnx mcc wrote:
> We have CENTOS 5.3 on DELL servers. I tried to us following command to copy remote files system to local:
>
> scp -rp oracle@ORA2:/home/app/oracle/10.2 .
>
> After SCP finish copy, I found some files on source file system using "link" but on target file systems it change to "physical file".
>
> Does there has way scp not change "link" setup?
>
If you want to preserve symlinks you probably want to use rsync instead
of scp.

--
Benjamin Franz

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Les Mikesell 12-21-2009 05:51 PM

scp copy remote files does NOT copy link?
 
mcclnx mcc wrote:
> We have CENTOS 5.3 on DELL servers. I tried to us following command to copy remote files system to local:
>
> scp -rp oracle@ORA2:/home/app/oracle/10.2 .
>
> After SCP finish copy, I found some files on source file system using "link" but on target file systems it change to "physical file".
>
> Does there has way scp not change "link" setup?

I've always preferred 'rsync -essh -aHv source host:path' over scp for
remote copies. It will generally get everything right and in the case
where part of the content is already there it is much more efficient.

--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

"nate" 12-21-2009 05:53 PM

scp copy remote files does NOT copy link?
 
mcclnx mcc wrote:

> Does there has way scp not change "link" setup?

use rsync, not scp

nate


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

"b.j. mcclure" 12-21-2009 06:21 PM

scp copy remote files does NOT copy link?
 
On Mon, 2009-12-21 at 12:51 -0600, Les Mikesell wrote:
> mcclnx mcc wrote:
> > We have CENTOS 5.3 on DELL servers. I tried to us following command to copy remote files system to local:
> >
> > scp -rp oracle@ORA2:/home/app/oracle/10.2 .
> >
> > After SCP finish copy, I found some files on source file system using "link" but on target file systems it change to "physical file".
> >
> > Does there has way scp not change "link" setup?
>
> I've always preferred 'rsync -essh -aHv source host:path' over scp for
> remote copies. It will generally get everything right and in the case
> where part of the content is already there it is much more efficient.
>
I know I'm going to be embarrassed by the answer to this one but I've
checked a couple rsync and ssh references, including man rsync, and do
not find an option -H. What is it?

Cheers!

CentOS 5.4, Linux 2.6.18-164.9.1.el5 x86_64 14:18:18 up 2 days, 20:25, 1
user, load average: 0.24, 0.14, 0.19

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

"nate" 12-21-2009 06:25 PM

scp copy remote files does NOT copy link?
 
b.j. mcclure wrote:

> I know I'm going to be embarrassed by the answer to this one but I've
> checked a couple rsync and ssh references, including man rsync, and do
> not find an option -H. What is it?

Looks like

-H, --hard-links preserve hard links

In my experience hard links aren't very common, symlinks on the other
hand are very common, and probably the type of link you were
encountering.

nate


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Tom H 12-21-2009 06:26 PM

scp copy remote files does NOT copy link?
 
>>> Does there has way scp not change "link" setup?

>> I've always preferred 'rsync -essh -aHv *source host:path' over scp for
>> remote copies. *It will generally get everything right and in the case
>> where part of the content is already there it is much more efficient.

> I know I'm going to be embarrassed by the answer to this one but I've
> checked a couple rsync and ssh references, including man rsync, and do
> not find an option -H. *What is it?

-H, --hard-links preserve hard links
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

"b.j. mcclure" 12-21-2009 06:30 PM

scp copy remote files does NOT copy link?
 
On Mon, 2009-12-21 at 11:25 -0800, nate wrote:
> b.j. mcclure wrote:
>
> > I know I'm going to be embarrassed by the answer to this one but I've
> > checked a couple rsync and ssh references, including man rsync, and do
> > not find an option -H. What is it?
>
> Looks like
>
> -H, --hard-links preserve hard links
>
> In my experience hard links aren't very common, symlinks on the other
> hand are very common, and probably the type of link you were
> encountering.
>
> nate
>
Darn. I knew it was dumb. ;-/
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
CentOS 5.4, Linux 2.6.18-164.9.1.el5 x86_64 14:29:22 up 2 days, 20:36, 1
user, load average: 0.13, 0.22, 0.20

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Peter Kjellstrom 12-21-2009 06:31 PM

scp copy remote files does NOT copy link?
 
On Monday 21 December 2009, b.j. mcclure wrote:
...
> I know I'm going to be embarrassed by the answer to this one but I've
> checked a couple rsync and ssh references, including man rsync, and do
> not find an option -H. What is it?

$ man rsync | grep "-H"
-a, --archive archive mode; same as -rlptgoD (no -H)
-H, --hard-links preserve hard links
want recursion and want to preserve almost everything (with -H
ply-linked files is expensive. You must separately specify -H.
-H, --hard-links

Cheers,
Peter
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Les Mikesell 12-21-2009 06:39 PM

scp copy remote files does NOT copy link?
 
Tom H wrote:
>>>> Does there has way scp not change "link" setup?
>
>>> I've always preferred 'rsync -essh -aHv source host:path' over scp for
>>> remote copies. It will generally get everything right and in the case
>>> where part of the content is already there it is much more efficient.
>
>> I know I'm going to be embarrassed by the answer to this one but I've
>> checked a couple rsync and ssh references, including man rsync, and do
>> not find an option -H. What is it?
>
> -H, --hard-links preserve hard links

Most of the other options to create as exact a duplicate as possible are
bundled into the '-a' option. However, since there is no efficient way
to handle hardlink matching and recreation (it needs a brute-force inode
table lookup), it is left separate.

--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


All times are GMT. The time now is 02:39 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.