LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-27-2009, 06:10 AM   #1
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,330

Rep: Reputation: 100Reputation: 100
recursive scp, no links across file systems


I am trying to copy my entire home directory to another computer with scp:

scp -o Compression=yes -rp luc@192.168.1.102:../luc ./

But scp is copying symlinks that point to other file systems! That will never fit in my otherwise small /home partition. How do I tell scp not to copy across file systems? There is no such option in the man page.

TIA.
 
Old 08-27-2009, 06:20 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
You can use tar across ssh. I suggest to login to the remote machine, then issue this command from there:
Code:
tar cf - /home/luc | ssh luc@localmachine tar xf -
this will send a tar archive of your remote home directory through the pipe and it will be un-tarred onto the local machine on the fly! Symbolic links are not followed in this case.
 
Old 08-27-2009, 08:03 AM   #3
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,330

Original Poster
Rep: Reputation: 100Reputation: 100
Thanks, but it is not clear. I can't make it work, tar "refuses to create an empty archive".
 
Old 08-27-2009, 08:17 AM   #4
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,330

Original Poster
Rep: Reputation: 100Reputation: 100
OK, I figured it out. It's copying. Thanks!
 
Old 08-27-2009, 08:27 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
In your example you are logged in the local machine and you copy from a remote location to your local machine. My suggestion is to login to the remote machine:
Code:
ssh luc@192.168.1.102
and from there run the above command, that is:
Code:
tar cf - /path/to/home/luc | ssh luc@address-of-local-machine tar xf -
this should not try to create an empty tar if /path/to/home/luc exists. I tested on my systems just now and it works.

Edit: oops... too late; I has been distracted while writing this last post! Good to know it works now!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ls with recursive option and file name doesn't work FromFPan2Fire Linux - Newbie 7 01-05-2010 10:21 AM
Read only file systems, custom live CDs, and embedded systems coffeecoffee Linux - Newbie 2 02-24-2009 11:09 PM
recursive scp w/o following links? WingnutOne Linux - General 6 09-09-2008 02:23 AM
Symbolic Links in Net::FTP::Recursive innuendo_98 Programming 0 07-07-2006 10:08 AM
SCP without soft links henriette Linux - Networking 1 08-27-2004 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration