How to configure Rsync services under Ubuntu _linux

Source: Internet
Author: User
Tags file copy file permissions rsync
Ubuntu installs the Rsync service by default, but does not have a profile under/etc, you can usually copy the sample files to/etc
#cp/usr/share/doc/rsync/examples/rsyncd.conf/etc
#vi/etc/rsyncd.conf
# Sample RSYNCD.CONF configuration file
# GLOBAL OPTIONS
MOTD FILE=/ETC/MOTD #登录欢迎信息
Log FILE=/VAR/LOG/RSYNCD #日志文件
# for PID file, does not use/var/run/rsync.pid if
# You are going to run rsync out of the init.d script.
PID File=/var/run/rsyncd.pid
Syslog Facility=daemon
#socket options=
# MODULE OPTIONS
[Rsync]
Comment = Public archive
Path =/home/soft/rsync
Use chroot = yes
# max Connections=10 #最大连接数
Lock file =/var/lock/rsyncd
# The default for read-only is yes ...
Read Only = yes
List = yes
UID = nobody
GID = Nogroup
# exclude =
# Exclude From =
# include =
# include from =
# Auth users =
# Secrets File =/etc/rsyncd.secrets
Strict modes = yes
# hosts Allow =
# hosts Deny =
Ignore errors = no
Ignore nonreadable = yes
Transfer logging = no
# log format =%t:host%h (%a)%o%f (%l bytes). Total%b bytes.
Timeout = 600
Refuse options = Checksum Dry-run
Dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2

Revise look personal situation, general modification Path=/home/soft/rsync for own directory
Create a new file under/etc/after the change is finished Rsyncd.pass
#vi/etc/rsyncd.pass
Backup:backup
: Wq
Modify Rsyncd.pass Permissions
#chmod 600/etc/rsyncd.pass
We can start rsync now.
#rsync--daemon
After successful startup, you can use lsof-i:873 to start normally, or you can view the/VAR/LOG/RSYNCD related log files.
Backup command: RSYNC-VZRTOPG--progress--delete backup@172.28.156.88::rsync/cygdrive/f/a
Note: cygdrive/f/a means f:\a directory

Detailed Format Description:
-v,–verbose Verbose mode output
-q,–quiet Thin Output mode
-c,–checksum turn on the check switch to force the verification of File transfer
-a,–archive archive mode, which represents the transfer of files recursively and maintains all file attributes equal to-rlptgod
-r,–recursive in recursive mode for subdirectories
-r,–relative Using relative path information
-b,–backup creates a backup, which means that the old file is renamed to the same file name when the destination already exists
~filename. You can use the –suffix option to specify different backup file prefixes.
–backup-dir store backup files (such as ~filename) in the directory.
-suffix=suffix defines the backup file prefix
-u,–update only updates, skipping over all files that already exist in DST, and that the file time is later than the file you want to back up.
(Do not overwrite the updated file)
-l,–links retaining Soft link knot
-l,–copy-links want to treat soft links like regular files
–copy-unsafe-links only copies links that point beyond the src Path directory tree
–safe-links ignores links to the SRC path tree
-h,–hard-links Keep Hard Links
-p,–perms Keep file permissions
-o,–owner Keep File owner information
-g,–group Keep file group information
-d,–devices Maintain device file information
-t,–times Keep file time information
-s,–sparse Special handling of sparse files to save DST space
-n,–dry-run reality which files will be transmitted
-w,–whole-file copy files without incremental detection
-x,–one-file-system do not cross file system boundaries
-b,–block-size=size test algorithm uses block size, default is 700 bytes
-e,–rsh=command Specifies a shell program that replaces rsh
–RSYNC-PATH=PATH Specifies the path information for the rsync command on the remote server
-c,–cvs-exclude use the same method as CVs to automatically ignore files to exclude files that you do not want to transfer
–existing updates only those files that already exist in DST, not the newly created files
–delete Delete files that are not in the DST SRC
–delete-excluded also deletes the receiving end of files that are excluded by the option specified
–delete-after after transmission is over
–ignore-errors in time IO errors are also deleted
–max-delete=num Delete NUM files up to
–partial retains files that are not fully transmitted for some reason, to expedite subsequent transmissions
–force forcibly deletes a directory, even if it is not empty
–numeric-ids does not match the user and group IDs of numbers to user and group names
–timeout=time IP timeout time in seconds
-i,–ignore-times don't skip files that have the same time and length
–size-only when deciding whether to back up a file, just look at the file size without considering the file time
–modify-window=num the time stamp window that determines whether a file is in the same time, default is 0
-t–temp-dir=dir Create temporary files in dir
–compare-dest=dir also compares files in DIR to determine whether a backup is required
-P is equivalent to –partial–progress display backup process
-z,–compress compression of backed-up files on transfer
–EXCLUDE=PATTERN Specifies to exclude file modes that do not require transfer
–INCLUDE=PATTERN Specifies the file mode that is not excluded and needs to be transferred
–exclude-from=file exclude files in the specified mode in file
–include-from=file does not exclude files that match the file-specified pattern
–version Print version Information
–address bound to a specific address
–CONFIG=FILE specifies a different profile and does not use the default rsyncd.conf file
–PORT=PORT Specifies the other rsync service ports
–blocking-io blocking IO for a remote shell
-stats gives the transfer status of some files
–progress transmission process in real time
–log-format=format Specify log file format
–password-file=file gets the password from file
–bwlimit=kbps limit I/O bandwidth, Kbytes per second
-H,–HELP Display Help information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.