LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-05-2005, 12:41 PM   #1
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: SuSE 9.2 Professional, OpenSuSE 10.1 64 bit, Open SuSE 10.2, Debian Etch
Posts: 535

Rep: Reputation: 30
copy/ftp/sftp/rsync from ssh'd machine


From my local machine, i log on to a remote machine via ssh.
How do I get files from the remote machine to the local?
 
Old 05-05-2005, 01:10 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
The best way is probably to use rsync. For example, let's say that your login to the remote machine is:

ssh abc@xyz.com

To retrieve a file from the remote machine called somefile.avi in the remote machine's temp directory and put it in the avi directory on the local machine:

rsync --rsh="ssh" -av --progress --partial abc@xyz.com:temp/somefile.avi avi/

The "--progress" option will keep you up to date on the transfer, and the "--partial" option will let you restart the transfer if there is an interruption (even if you kill the rsync manually). Check the man page (man rsync) for more details.

Last edited by macemoneta; 05-05-2005 at 01:11 PM.
 
Old 05-05-2005, 01:11 PM   #3
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Using scp would look something like this. If you don't have that machine in dns or the host file, you will need to use the ip address of that machine.
scp remote_machine:/mnt/images/some_file /local/folder

Rsync would look something like this..
rsync -avz -e ssh user@remote_machine:/some/folder /local/folder
 
Old 05-05-2005, 01:39 PM   #4
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: SuSE 9.2 Professional, OpenSuSE 10.1 64 bit, Open SuSE 10.2, Debian Etch
Posts: 535

Original Poster
Rep: Reputation: 30
Thanks for the rsync example.
It worked and you saved me bunch of time trying to figure it out.
Is there any particular reasons why rsync is the "best way".
(other than it works well)
 
Old 05-05-2005, 02:01 PM   #5
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
Rsync sends only changed data. If you've updated a large file, only the changes will be sent (very fast). It can restart a partially sent file from where it left off (--partial); scp and sftp cannot. It can use compression on low bandwidth connections (--compress), for compressible data; scp and sftp cannot. You can limit your bandwidth consumption (--bwlimit), so you don;t monopolize a machine; scp and sftp cannot. It performs its own checksum to insure that data is transferred correctly; scp and sftp rely on the TCP checking, which can have problems on high error rate facilities. It can recursively transfer directory trees (--recursive); sftp cannot. It can copy file attributes (permissions, times, etc.); scp and sftp do not. It can keep local and remote directories synchronized; scp and sftp cannot. Many more reasons.

In short, there are lots of reasons rsync is the best way. It's a very useful tool to learn to use.
 
Old 05-05-2005, 02:16 PM   #6
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: SuSE 9.2 Professional, OpenSuSE 10.1 64 bit, Open SuSE 10.2, Debian Etch
Posts: 535

Original Poster
Rep: Reputation: 30
thanks!
 
  


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
rsync syntax for local copy hoover93 Linux - Software 3 12-21-2012 02:39 AM
scp: copy a file from local machine to remote machine seran Linux - Newbie 8 10-30-2007 12:23 PM
rsync syntax to skip directory, but copy select files.. tnicol Linux - Software 3 07-24-2007 05:40 AM
trying to copy files from another machine to the local machine using telnet,..how? shrike_912 Programming 6 03-14-2006 04:45 PM
copy from windows machine to a linux machine s_deepblue Linux - Networking 3 03-12-2005 01:43 PM


All times are GMT -5. The time now is 09:57 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration