This shows you the differences between two versions of the page.
rsync [2010/08/03 21:54] k2patel |
rsync [2020/08/10 02:35] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Rsync ====== | ||
- | ==== General rsync Commands ==== | ||
- | |||
- | |||
- | ==== Authenticated Rsync ==== | ||
- | |||
- | define rsync mount point in rsyncd.conf | ||
- | <code bash | rsyncd.conf> | ||
- | [root] | ||
- | path = /srv/www/htdocs | ||
- | secrets file = /etc/rsyncd/rsync.secret | ||
- | auth users = htdocs | ||
- | read only = false | ||
- | write only = true | ||
- | list = false | ||
- | </code> | ||
- | |||
- | <code text | rsync.secret> | ||
- | rsyncusr:password123 | ||
- | </code> | ||
- | |||
- | |||
- | **NOTE :** | ||
- | * Password is clear text password. | ||
- | * Make sure password file is not world readable else it will fail to authenticate. | ||
- | |||
- | |||
- | Define script for rsync OR run it from command line. | ||
- | |||
- | <code bash | rsync_test.sh> | ||
- | #!/bin/sh | ||
- | |||
- | export RSYNC_PASSWORD=password123 | ||
- | /usr/local/bin/rsync -az --delete --exclude='.*' /srv/www/htdocs/ rsync://rsyncusr@rsync.host.com/root/ | ||
- | |||
- | </code> |