<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ca">
	<id>http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Rsync</id>
	<title>Rsync - Historial de revisió</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Rsync"/>
	<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Rsync&amp;action=history"/>
	<updated>2026-08-30T08:38:12Z</updated>
	<subtitle>Historial de revisió per a aquesta pàgina del wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=Rsync&amp;diff=247767&amp;oldid=prev</id>
		<title>Joan a 13:27, 7 nov 2011</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Rsync&amp;diff=247767&amp;oldid=prev"/>
		<updated>2011-11-07T13:27:29Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__TOC__&lt;br /&gt;
Serveix per fer còpies de seguretat remotes, amb moltes opcions. Concretament, còpies de seguretat incrementals&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install rsync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME&lt;br /&gt;
       rsync -- a fast, versatile, remote (and local) file-copying tool&lt;br /&gt;
SYNOPSIS&lt;br /&gt;
       Local:  rsync [OPTION...] SRC... [DEST]&lt;br /&gt;
&lt;br /&gt;
       Access via remote shell:&lt;br /&gt;
         Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]&lt;br /&gt;
         Push: rsync [OPTION...] SRC... [USER@]HOST:DEST&lt;br /&gt;
&lt;br /&gt;
       Access via rsync daemon:&lt;br /&gt;
         Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST]&lt;br /&gt;
               rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]&lt;br /&gt;
         Push: rsync [OPTION...] SRC... [USER@]HOST::DEST&lt;br /&gt;
               rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       Usages with just one SRC arg and no DEST arg will list the source files&lt;br /&gt;
       instead of copying.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is famous  for  its delta-transfer  algorithm,  which  reduces the amount of data sent over the network by sending only the differences between  the  source  files and  the  existing  files in the destination. Rsync is widely used for backups and mirroring and as an improved copy command for everyday use.&lt;br /&gt;
&lt;br /&gt;
Rsync  finds  files  that  need to be transferred using a &amp;quot;quick check&amp;quot; algorithm (by default) that looks for files that have changed  in  size or   in  last-modified  time.   Any  changes  in  the  other  preserved attributes (as requested by options) are made on the  destination  file directly  when  the quick check indicates that the file's data does not need to be updated.&lt;br /&gt;
&lt;br /&gt;
Pot utilitzar SSH o RSH. No requreix privilegis de super-usuari.&lt;br /&gt;
&lt;br /&gt;
Rsync  copies  files either to or from a remote host, or locally on the current host (it does not support  copying  files  between  two  remote hosts).&lt;br /&gt;
&lt;br /&gt;
There  are  two  different  ways  for rsync to contact a remote system: using a remote-shell program as the transport (such as ssh or  rsh)  or contacting  an  rsync daemon directly via TCP.  The remote-shell transport is used whenever the source or destination path contains a  single colon  (:)  separator  after a host specification.  Contacting an rsync daemon directly happens when the source or destination path contains  a double  colon  (::)  separator  after  a host specification, OR when an rsync:// URL is specified (see also the  &amp;quot;USING  RSYNC-DAEMON  FEATURES VIA  A REMOTE-SHELL CONNECTION&amp;quot; section for an exception to this latter rule).&lt;br /&gt;
&lt;br /&gt;
As a special case, if a single source arg is specified without a destination, the files are listed in an output format similar to &amp;quot;ls -l&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As expected, if neither the source or destination path specify a remote host, the copy occurs locally (see also the --list-only option).&lt;br /&gt;
&lt;br /&gt;
Com a mínim l'origen o el destí han de ser remots, però no ho poden ser tots dos.&lt;br /&gt;
&lt;br /&gt;
Exemple d'ús bàsic:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync -av /path/to/source/directory /path/to/target/directory&lt;br /&gt;
rsync -av /home/joan/how_to_ubuntu /media/disk/dades&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-a: &amp;quot;archive&amp;quot; mode, which  ensures  that  symbolic  links,  devices,  attributes,  permissions, ownerships, etc. are preserved in the transfer.&lt;br /&gt;
&lt;br /&gt;
links:&lt;br /&gt;
[http://everythinglinux.org/rsync/ http://everythinglinux.org/rsync/]&lt;br /&gt;
&lt;br /&gt;
[http://rsync.samba.org/ftp/rsync/rsync.html http://rsync.samba.org/ftp/rsync/rsync.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
script bash de còpies de seguretat&lt;br /&gt;
&lt;br /&gt;
[http://enavas.blogspot.com/2008/01/copias-de-seguridad-incrementales-con.html http://enavas.blogspot.com/2008/01/copias-de-seguridad-incrementales-con.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
per a fer la restauració:&lt;br /&gt;
&lt;br /&gt;
[http://www.novell.com/coolsolutions/tip/658.html http://www.novell.com/coolsolutions/tip/658.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the event that I want to perform a full data restore of the entire USERS directory, I can pull data back from the RSYNC server to the source server with a restusrs.ncf file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync -rav RSYNC1::USERS --volume=DATA: users --update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will restore any files deleted since the last backup, by reversing the source and target strings. The --update switch will ensure that any files modified since the last backup will not be overwritten.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
link [http://www.gnuchile.cl/index.php?not=238&amp;amp;id_page=59&amp;amp;conf=comments&amp;amp;blog=tsolar http://www.gnuchile.cl/index.php?not=238&amp;amp;id_page=59&amp;amp;conf=comments&amp;amp;blog=tsolar]&lt;br /&gt;
&lt;br /&gt;
En fin, aquí estoy escribiendo acerca de mis experiencias con rsync.&lt;br /&gt;
&lt;br /&gt;
Para crear un servidor rsync, en su Debian (o distro similar) haga &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ apt-get install rsync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Con eso ya tendrá a su PC como servidor rsync :)&lt;br /&gt;
&lt;br /&gt;
Después de eso, para respaldar desde Windows, puedes usar Deltacopy (GPLv2)&lt;br /&gt;
Deltacopy es bastante fácil de usar, apenas se cree un perfil de respaldo en el cliente basta con un click para restaurar los archivos...&lt;br /&gt;
&lt;br /&gt;
Si quieres respaldar desde un GNU/Linux puedes hacer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync [opciones] &amp;lt;directorioorigen&amp;gt; &amp;lt;directoriodestino&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Yo lo hago así:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync -v -rlt -z --delete /mi/directorio/a/respaldar/ /mi/directorio/de/respaldo/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
y para restaurar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync -v -rlt -z  /mi/directorio/de/respaldo /mi/directorio/a/respaldar/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Y creé un script y lo agregué en el crontab con el que creo un directorio según la fecha y hora en la que se realiza el respaldo. El directorio lo creo así:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FECHA=$(date +%Y_%m_%d-%H_%M_%S)&lt;br /&gt;
DESTDIR1=&amp;quot;/mi/directorio/de/respaldo/$FECHA&amp;quot;&lt;br /&gt;
mkdir $DESTDIR1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
el script completo es:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
BACKDIR=&amp;quot;/mi/directorio/a/respaldar/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FECHA=$(date +%Y_%m_%d-%H_%M_%S)&lt;br /&gt;
DESTDIR1=&amp;quot;/mi/directorio/de/respaldo/$FECHA&amp;quot;&lt;br /&gt;
mkdir $DESTDIR1&lt;br /&gt;
DESTDIR=&amp;quot;$DESTDIR1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
OPTS=&amp;quot;-v -rlt -z --delete&amp;quot;&lt;br /&gt;
&lt;br /&gt;
rsync $OPTS $BACKDIR $DESTDIR&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aah me acordé que rsync trabaja con algunas carpetas configuradas pa verlas desde DeltaCopy :)&lt;br /&gt;
&lt;br /&gt;
el archivo de configuración es /etc/rsyncd.conf y tiene algo así:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[respaldo]&lt;br /&gt;
&lt;br /&gt;
    path = /mi/directorio/de/respaldo&lt;br /&gt;
    comment = Backup &lt;br /&gt;
    uid = tom&lt;br /&gt;
    gid = tom&lt;br /&gt;
    read only = false&lt;br /&gt;
    auth users = tom&lt;br /&gt;
    secrets file = /etc/rsyncd.secrets&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
en el /etc/rsyncd.secrets están los usuarios y contraseñas así: &amp;lt;usuario&amp;gt;:&amp;lt;contraseña&amp;gt;&lt;br /&gt;
&lt;br /&gt;
así que mi /etc/rsyncd.secrets es algo así:&lt;br /&gt;
&lt;br /&gt;
tom:micontraseña&lt;br /&gt;
&lt;br /&gt;
y para respaldar desde un GNU/Linux a otro se pone:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync -v -rlt -z --delete &amp;quot;/mi/directorio/a/respaldar&amp;quot; &amp;quot;tom@&amp;lt;ipdemiservidor&amp;gt;::respaldo/&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
creo que eso es todo...&lt;br /&gt;
&lt;br /&gt;
saludos :)&lt;br /&gt;
==Update novembre 2011==&lt;br /&gt;
rsync està explicat a classe, i la informació actualitzada:&lt;br /&gt;
*[[C%C3%B2pies_de_Seguretat_amb_rsync]]&lt;br /&gt;
*[[Assegurar_les_dades:_C%C3%B2pies_de_seguretat#C.C3.B2pies_de_seguretat_amb_rsync]]&lt;/div&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
</feed>