Rsync over SSH Daemon
What is Rsync ?
rsync is a software application for Unix systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction. rsync can copy or display directory contents and copy files, optionally using compression and recursion.
In daemon mode, rsync listens on the default TCP port of 873, serving files in the native rsync protocol or via a remote shell such as RSH or SSH. In the latter case, the rsync client executable must be installed on both the local and the remote host.
Download Rsync
#cd /root
#wget http://samba.org/ftp/rsync/rsync-3.0.7.tar.gz
#tar -zxvf rsync-3.0.7.tar.gz
#cd rsync-3.0.7
#./configure
#make && make install
Remove Current Rsync / Old Rsync packages
#rpm -e rsync*
Installed Rsync Version
#/usr/local/bin/rsync -v
rsync version 3.0.7 protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, no ACLs, xattrs, iconv, symtimes
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
Setup SSH Without Password
#ssh-keygen -t dsa
#scp .ssh/id_dsa.pub username@192.168.1.10:~/.ssh/authorized_keys
#cat .ssh/id_dsa.pub > .ssh/authorized_keys
Setting Up Backup Over SSH via Crontab
#crontab -e
*/5 * * * * /usr/bin/rsync -e "ssh -l username" -portgWlz /path/to/source username@192.168.1.10:/path/to/destination
if data was originally in both server, assuming you want rsync to delete any file from destination/ that is not in source/, you'll need to use the --delete flag:
*/5 * * * * /usr/bin/rsync -e "ssh -l username" -portgWlz /path/to/source username@192.168.1.10:/path/to/destination --delete
Recent blog posts |
Recent comments
|
Comments
Post new comment