Rsync: Difference between revisions

From Grid5000
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Portal|Admin}}
{{Portal|User}}
{{Portal|Service}}
{{Portal|Tutorial}}
[[Image:Scp_rsync.png|right|thumb|Transfer time of 2531 source code files (total size: 46M, part of the linux kernel sources) between two Grid5000 cluster nodes, with varying latency artificially added using Netem.]]
Like '''scp''', '''rsync''' is a tool for transfer of files between systems. Such tools are very useful on Grid5000, for example to synchronize your local source tree with the one on the cluster node you are using.
Like '''scp''', '''rsync''' is a tool for transfer of files between systems. Such tools are very useful on Grid5000, for example to synchronize your local source tree with the one on the cluster node you are using.


Line 5: Line 11:
* when a remote copy is already present, '''rsync''' only transfers the differences between your local copy and the remote copy. This is very useful during development, because you often have to transfer only small changes (a bug fix).
* when a remote copy is already present, '''rsync''' only transfers the differences between your local copy and the remote copy. This is very useful during development, because you often have to transfer only small changes (a bug fix).


[[Image:Scp_rsync.png|right|thumb|Transfer time of 2531 source code files (total size: 46M, part of the linux kernel sources) between two Grid5000 cluster nodes, with varying latency artificially added using Netem.]]
== Example ==
Transfers the local directory named "source" to the remote host in /tmp
rsync -avzP source remotelogin@remotehost:/tmp
 
'''Important:'''
With '''scp''', "scp source rlogin@rhost:/tmp" and "scp source'''/''' rlogin@rhost:/tmp" are the same. With '''rsync''', they aren't :
* With ''source'', a directory named ''source'' is created in /tmp, with the files in it.
* With ''source/'', the files in ''source'' are copied directly in /tmp.


== External Links ==
== External Links ==
* [http://www.samba.org/rsync/ Rsync homepage]
* [http://en.wikipedia.org/wiki/Rsync Rsync on Wikipedia]
* [http://en.wikipedia.org/wiki/Rsync Rsync on Wikipedia]
* [http://www.samba.org/rsync/ Rsync homepage]

Latest revision as of 09:16, 28 July 2009

Transfer time of 2531 source code files (total size: 46M, part of the linux kernel sources) between two Grid5000 cluster nodes, with varying latency artificially added using Netem.

Like scp, rsync is a tool for transfer of files between systems. Such tools are very useful on Grid5000, for example to synchronize your local source tree with the one on the cluster node you are using.

rsync has several advantages over scp :

  • its protocol is more efficient. scp considers one file after the other, which doesn't perform very well on network links with high bandwidth but medium latency, like the typical Grid5000 inter-cluster link, or the link between your lab and your cluster node. Also, scp performs poorly (compared to rsync) when transfering many small files (your typical source tree).
  • when a remote copy is already present, rsync only transfers the differences between your local copy and the remote copy. This is very useful during development, because you often have to transfer only small changes (a bug fix).

Example

Transfers the local directory named "source" to the remote host in /tmp

rsync -avzP source remotelogin@remotehost:/tmp

Important: With scp, "scp source rlogin@rhost:/tmp" and "scp source/ rlogin@rhost:/tmp" are the same. With rsync, they aren't :

  • With source, a directory named source is created in /tmp, with the files in it.
  • With source/, the files in source are copied directly in /tmp.

External Links