rsync
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
rsync [2012/05/30 19:46] – creado javi | rsync [2024/11/14 18:05] (current) – [Subtituyendo a scp reanuda en caso de corte] jose | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== rsync ====== | ||
+ | |||
+ | ===== Subtituyendo a scp reanuda en caso de corte ===== | ||
+ | rsync --partial --progress -e ssh archivo.txt usuario@192.168.1.100:/ | ||
+ | |||
+ | Simplificando: | ||
+ | rsync -P -e ssh archivo.txt usuario@192.168.1.100:/ | ||
+ | -P: combina las opciones --partial y --progress en una sola, simplificando así la escritura. | ||
+ | |||
+ | copy remote | ||
+ | |||
+ | Mirar inotify que solo lanza eventos cuando hay modificación en ficheros para evitar rsync en cron | ||
+ | |||
+ | ===== Receta 1 ===== | ||
+ | |||
http:// | http:// | ||
Line 5: | Line 20: | ||
Explained: | Explained: | ||
- | -e ssh rsync will use ssh client instead of rsh | + | -e ssh rsync will use ssh client instead of rsh\\ |
- | -z compress file transfer | + | -z compress file transfer\\ |
- | -t preserve time (other attributes as owner or permissions are also possible) | + | -t preserve time (other attributes as owner or permissions are also possible)\\ |
- | -P resume incomplete file transfer | + | -P resume incomplete file transfer\\ |
- | -r recursive into subdirectories | + | -r recursive into subdirectories\\ |
-v verbose | -v verbose | ||
+ | |||
+ | ===== Receta 2 ===== | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | SOURCE="/ | ||
+ | DESTINATION="/ | ||
+ | LOG="/ | ||
+ | RSYNC="/ | ||
+ | PORT=" | ||
+ | # Requires previous ssh keys exchange | ||
+ | # http:// | ||
+ | USER=" | ||
+ | REMOTE_HOST=" | ||
+ | |||
+ | DATE=" | ||
+ | |||
+ | echo " | ||
+ | ################### | ||
+ | |||
+ | $RSYNC -arv --no-implied-dirs --ignore-errors --rsh "ssh -p$PORT" | ||
+ | |||
+ | DATE=" | ||
+ | |||
+ | echo " | ||
+ | ################### | ||
+ | </ | ||
+ | |||
+ | ===== Copiar evitando directorios de subversion ===== | ||
+ | |||
+ | rsync -r --exclude=.svn / | ||
+ |
rsync.1338407163.txt.gz · Last modified: 2015/04/13 20:19 (external edit)