rsync --partial --progress -e ssh archivo.txt usuario@192.168.1.100:/ruta/al/destino
Simplificando:
rsync -P -e ssh archivo.txt usuario@192.168.1.100:/ruta/al/destino
-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
http://techtavern.wordpress.com/2008/11/19/resume-scprsync-file-transfer/
rsync -vrPtz -e ssh host:/remote_path/* /local_path/
Explained:
-e ssh rsync will use ssh client instead of rsh
-z compress file transfer
-t preserve time (other attributes as owner or permissions are also possible)
-P resume incomplete file transfer
-r recursive into subdirectories
-v verbose
#!/bin/bash SOURCE="/var/www/wiki.legido.com/" DESTINATION="/mnt/data/backups/wiki.legido.com/" LOG="/var/log/backup_wiki_legido_com.log" RSYNC="/usr/bin/rsync" PORT="2223" # Requires previous ssh keys exchange # http://wiki.legido.com/doku.php?id=informatica:linux:ssh:login_intercambio_claves USER="user" REMOTE_HOST="remotehost.domain.com" DATE="$(date +%d/%m/%Y) $(date +%H:%M:%S)" echo " ################### START: $DATE ##################" >> $LOG $RSYNC -arv --no-implied-dirs --ignore-errors --rsh "ssh -p$PORT" $USER@$REMOTE_HOST:$SOURCE $DESTINATION >> $LOG 2>&1 DATE="$(date +%d/%m/%Y) $(date +%H:%M:%S)" echo " ################### END: $DATE ##################" >> $LOG
rsync -r --exclude=.svn /home/user/progname/ /home/user/progname.copy