Difference between revisions of "Rsync"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
<metadesc>Easy example how to use rsync: rsync -avv --stats --progress --partial /srv/www/htdocs server:/srv/www</metadesc>
 
Rsync helps you to keep two folders in sync. This is possible over the network or local.
 
Rsync helps you to keep two folders in sync. This is possible over the network or local.
  
Copy a folder from ''server'' to the current working directory:
+
= over the network =
  rsync -avv --stats --progress --partial server:/srv/repos/isos/SLES9/i386/SP2 .
+
The following command sends the directory /srv/www/htdocs over to ''server'':
 +
  rsync <abbr title="archive mode: recurse into directories, copy symlinks as symlinks, preserve permissions, modification time, group, owner, special device files; be very verbose">-avv</abbr> --stats <abbr title="show a progress">--progress</abbr> --partial /srv/www/htdocs ''server'':/srv/www
 +
 
 +
;Common mistake: There is a difference between /srv/www/htdocs and /srv/www/htdocs'''/'''.
 +
 
 +
= locally =
 
Copy a folder ''.VirtualBox'' to /root:
 
Copy a folder ''.VirtualBox'' to /root:
 
  rsync -avv --stats --progress --partial .VirtualBox/ /root/.VirtualBox
 
  rsync -avv --stats --progress --partial .VirtualBox/ /root/.VirtualBox
 +
 +
= See also =
 +
* [[cloning]]  --  how to clone a complete computer incl. [[device]] files
 +
* [[unison]]  --  a "graphical rsync"
 +
* [http://linux.die.net/man/1/rsync rsync's man page]
  
 
[[Category:Command]]
 
[[Category:Command]]

Latest revision as of 14:04, 15 December 2014

Rsync helps you to keep two folders in sync. This is possible over the network or local.

over the network

The following command sends the directory /srv/www/htdocs over to server:

rsync -avv --stats --progress --partial /srv/www/htdocs server:/srv/www
Common mistake
There is a difference between /srv/www/htdocs and /srv/www/htdocs/.

locally

Copy a folder .VirtualBox to /root:

rsync -avv --stats --progress --partial .VirtualBox/ /root/.VirtualBox

See also