Method 1: using ssh rsync, it need to input password unless using ssh authentication (ssh-auth-keys).
e.g. rsync -avcrog --delete /source/ user@backupip:/backup
Method 2: using rsyncd, and rsync to push / pull the data from the rsyncd server. However, the rsyncd need to be running either by stand-alone daemon (rsync --daemon), inetd.
e.g. /etc/rsyncd.conf
uid = root
gid = root
[name]
hosts allow =
read only = true/false
write only = true
path = /path
auth users = user1,user2
secrets file = rsyncd.secrets
rsyncd.secrets / rsyncd.password
user:password
(old version need cr)
It seems it don't need to restart rsyncd after modify the rsyncd.conf to take effect.
3 comments:
http://everythinglinux.org/rsync/rsync_content.html
for resyncd: we can use either --password-file=resyncd.password, or RSYNC_PASSWORD=<password> rsync ...
-b, --backup
With this option, preexisting destination files are renamed as
each file is transferred or deleted. You can control where the
backup file goes and what (if any) suffix gets appended using
the --backup-dir and --suffix options.
--backup-dir=DIR
In combination with the --backup option, this tells rsync to
store all backups in the specified directory. This is very use-
ful for incremental backups. You can additionally specify a
backup suffix using the --suffix option (otherwise the files
backed up in the specified directory will keep their original
filenames). If DIR is a relative path, it is relative to the
destination directory (which changes in a recursive transfer).
--suffix=SUFFIX
This option allows you to override the default backup suffix
used with the --backup (-b) option. The default suffix is a ~ if
no --backup-dir was specified, otherwise it is an empty string.
-u, --update
This forces rsync to skip any files for which the destination
file already exists and has a date later than the source file.
In the currently implementation, a difference of file format is
always considered to be important enough for an update, no mat-
ter what date is on the objects. In other words, if the source
has a directory or a symlink where the destination has a file,
the transfer would occur regardless of the timestamps. This
might change in the future (feel free to comment on this on the
mailing list if you have an opinion).
Post a Comment