rsync配置详解
配置 文件/etc/rsyncd.conf 由模块和参数组成.模块由包括在方括号中的模块名开始,直到下一模块的开始为结束.模块的参数格式为 " name = value " 在参数中,只有第一个等号是最主要的. 以#开头的行,被忽略掉. daemon必需有root权限,绑定端口在1024以下(默认是8
在参数中,只有第一个等号是最主要的.
以#开头的行,被忽略掉.
daemon必需有root权限,绑定端口在1024以下(默认是873),或者配置文件权限.可以通过inetd,或stand-alone daemon,或才通过远程的rsync客户端对其执行 访问.
如果使其以stand-alone方式运行,运用命令:rsync --daemon
以inetd方式运行: 在/etc/services文件中添加以下一行:
rsync 873/tcp
在/etc/inetd.conf文件中添加以下一行:
rsync stream tcp nowait root /usr/bin/rsync rsyncd --daemon
--------------全局参数-----------------------------
motd file
定义当客户端访问时看到的信息.默认没有.
pid file
定义rsync daemon将其PID写入的文件,如果此文件存在,rsync daemon会终止,而不是覆盖
port
定义daemon监听的端口,(默认是873),如果daemon在被inetd启动时加上 --port参数时,会
忽略此参数.
address
覆盖daemon默认监听的IP地址.如果daemon是被inetd启动,并且有 --address参数时,会被
忽略
socket options
用来防止 被人不停的连接.可以配置为所有socket的端口的传输速度:faster or slower.
会被在命令行的--sockopts覆盖
--------------模块参数----------------------------
模块名无法包括斜钱和关上的方括号.
comment
当客户端取得可用模块列表时,在模块名后执行 显示的注示.默认没有.
path
在这个模块中,daemon可以运用的文件系统.必须配置.
use chroot
如果被设为"true",daemon会在给客户端传输文件前"chroot to the path".
numberic ids
对当前daemon模块,关上能过名字对users 和groups执行 识别.会阻止daemon试图load任何usr/group-related file or libraries.如同客户端运用了 --numeric-ids参数一样.默
认在chroot中启用,在non-chroot中关上 .
munge symlinks
使传进来的文件的链接失效,但是可以还原 .只有在use chroot中并且inside-chroot path
is "/"时,才会启动,其它时全部失效.
charset
配置模块的文件名的存储编码. 如果客户端运用 --icov参数,会被失效.
max connections
配置最大连接数.默认为0,意为无限定 .负值为关上这个模块.
log file
不设会运用 syslog
syslog facility
指定syslog 的名字来启示录rsync daemon.
max verbosity
控制信息的最大数量.默认为1,允许客户端请求 one level of verbosity
lock file
指定文件用来支撑 "max connections"参数. 默认为/var/run/rsyncd.lock
read only
指定客户端能无法 可以上传文件.默认对所有模块都为true
write only
不允许下载.
list
能无法 允许客户端可以查看可用模块列表.默认为可以.
uid
指定用户名或UID取代root.默认为-2,意为nobody
gid
同上
fake super
设为yes,使文件的权限不以root权限.
filter
指定filter chain,指定哪些文件可以让客户端进入.
exclude
include
会覆盖exclude
exclude from<br>include from<br>incoming chmod 指定传入文件的权限<br>outgoing chmod<br>auth users
指定以空格或,分隔的用户可以运用些模块.用户不一定要在本地系统中存在.默认所有用
户无密码的访问(anonymous rsync)
secrets file
指定用户名和密码.格式 用户名:密码
strict modes
指定 secrets file的权限能无法 被检查.true or false
hosts allow
指定可以联系的客户端用户名和IP.address/mask,a.b.c.d,hostname,hostname pattern using wildcards
hosts deny
默认没有.
ignore errors
忽略I/P不正确 .
ignore nonreadable
忽略对用户没有可读的文件.
transfer logging
log format
定义logging file transfers,当transfer logging启用时.
<font face="NSimsun"> * %a the remote IP address<br> * %b the number of bytes actually transferred<br> * %B the permission bits of the file (e.g. rwxrwxrwt)<br> * %c the total size of the block checksums received for the basis file (only<br> when sending)<br> * %f the filename (long form on sender; no trailing "/")<br> * %G the gid of the file (decimal) or "DEFAULT"<br> * %h the remote host name<br> * %i an itemized list of what is being updated<br> * %l the length of the file in bytes<br> * %L the string " -> SYMLINK", " => HARDLINK", or "" (where SYMLINK or <br> HARDLINK is a filename)<br> * %m the module name<br> * %M the last-modified time of the file<br> * %n the filename (short form; trailing "/" on dir)<br> * %o the operation, which is "send", "recv", or "del." (the latter includes <br> the trailing period)<br> * %p the process ID of this rsync session<br> * %P the module path<br> * %t the current date time<br> * %u the authenticated username or an empty string<br> * %U the uid of the file (decimal) <br>timeout</font>
默认为0,意no timeout,建议为600(10分钟)
refuse options
daemon拒绝的rsync command line参数
dont compress
指定文件不被压缩.压缩耗CPU
pre-xfer exec,post-xfer exec
在传输开始或结束运行的命令.下面是配置的环境变量:
<font face="NSimsun"> * RSYNC_MODULE_NAME: The name of the module being accessed.<br> * RSYNC_MODULE_PATH: The path configured for the module.<br> * RSYNC_HOST_ADDR: The accessing host's IP address.<br> * RSYNC_HOST_NAME: The accessing host's name.<br> * RSYNC_USER_NAME: The accessing user's name (empty if no user).<br> * RSYNC_PID: A unique number for this transfer.<br> * RSYNC_REQUEST: (pre-xfer only) The module/path info specified by the user <br> (note that the user can specify multiple source files, so the request can be<br> something like "mod/path1 mod/path2", etc.).<br> * RSYNC_ARG#: (pre-xfer only) The pre-request arguments are set in these <br> numbered values. RSYNC_ARG0 is always "rsyncd", and the last value contains <br> a single period.<br> * RSYNC_EXIT_STATUS: (post-xfer only) the server side's exit value. This will <br> be 0 for a successful run, a positive value for an error that the server <br> generated, or a -1 if rsync failed to exit properly. Note that an error that<br> occurs on the client side does not currently get sent to the server side, so<br> this is not the final exit status for the whole transfer.<br> * RSYNC_RAW_STATUS: (post-xfer only) the raw exit value from waitpid() . </font>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

When deleting or decompressing a folder on your computer, sometimes a prompt dialog box "Error 0x80004005: Unspecified Error" will pop up. How should you solve this situation? There are actually many reasons why the error code 0x80004005 is prompted, but most of them are caused by viruses. We can re-register the dll to solve the problem. Below, the editor will explain to you the experience of handling the 0x80004005 error code. Some users are prompted with error code 0X80004005 when using their computers. The 0x80004005 error is mainly caused by the computer not correctly registering certain dynamic link library files, or by a firewall that does not allow HTTPS connections between the computer and the Internet. So how about

Quark Netdisk and Baidu Netdisk are currently the most commonly used Netdisk software for storing files. If you want to save the files in Quark Netdisk to Baidu Netdisk, how do you do it? In this issue, the editor has compiled the tutorial steps for transferring files from Quark Network Disk computer to Baidu Network Disk. Let’s take a look at how to operate it. How to save Quark network disk files to Baidu network disk? To transfer files from Quark Network Disk to Baidu Network Disk, you first need to download the required files from Quark Network Disk, then select the target folder in the Baidu Network Disk client and open it. Then, drag and drop the files downloaded from Quark Cloud Disk into the folder opened by the Baidu Cloud Disk client, or use the upload function to add the files to Baidu Cloud Disk. Make sure to check whether the file was successfully transferred in Baidu Cloud Disk after the upload is completed. That's it

Windows operating system is one of the most popular operating systems in the world, and its new version Win11 has attracted much attention. In the Win11 system, obtaining administrator rights is an important operation. Administrator rights allow users to perform more operations and settings on the system. This article will introduce in detail how to obtain administrator permissions in Win11 system and how to effectively manage permissions. In the Win11 system, administrator rights are divided into two types: local administrator and domain administrator. A local administrator has full administrative rights to the local computer

Understanding Linux Bashrc: Function, Configuration and Usage In Linux systems, Bashrc (BourneAgainShellruncommands) is a very important configuration file, which contains various commands and settings that are automatically run when the system starts. The Bashrc file is usually located in the user's home directory and is a hidden file. Its function is to customize the Bashshell environment for the user. 1. Bashrc function setting environment

Recently, many netizens have asked the editor, what is the file hiberfil.sys? Can hiberfil.sys take up a lot of C drive space and be deleted? The editor can tell you that the hiberfil.sys file can be deleted. Let’s take a look at the details below. hiberfil.sys is a hidden file in the Windows system and also a system hibernation file. It is usually stored in the root directory of the C drive, and its size is equivalent to the size of the system's installed memory. This file is used when the computer is hibernated and contains the memory data of the current system so that it can be quickly restored to the previous state during recovery. Since its size is equal to the memory capacity, it may take up a larger amount of hard drive space. hiber

Detailed explanation of division operation in OracleSQL In OracleSQL, division operation is a common and important mathematical operation, used to calculate the result of dividing two numbers. Division is often used in database queries, so understanding the division operation and its usage in OracleSQL is one of the essential skills for database developers. This article will discuss the relevant knowledge of division operations in OracleSQL in detail and provide specific code examples for readers' reference. 1. Division operation in OracleSQL

Title: How to configure and install FTPS in Linux system, specific code examples are required. In Linux system, FTPS is a secure file transfer protocol. Compared with FTP, FTPS encrypts the transmitted data through TLS/SSL protocol, which improves Security of data transmission. In this article, we will introduce how to configure and install FTPS in a Linux system and provide specific code examples. Step 1: Install vsftpd Open the terminal and enter the following command to install vsftpd: sudo

Detailed explanation of the role of .ibd files in MySQL and related precautions MySQL is a popular relational database management system, and the data in the database is stored in different files. Among them, the .ibd file is a data file in the InnoDB storage engine, used to store data and indexes in tables. This article will provide a detailed analysis of the role of the .ibd file in MySQL and provide relevant code examples to help readers better understand. 1. The role of .ibd files: storing data: .ibd files are InnoDB storage
