rsync配置文件
配置文件位置/etc/rsyncd.conf
uid = rsync
gid = rsync
port = 873
fake super = yes
use chroot = no
max connections = 200
timeout = 600
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
ignore errors
read only = false
list = false
hosts allow = 172.16.1.0/24
auth users = rsync_backup
secrets file = /etc/rsync.password
[backup]
path = /backup
rsync选项
选项 | 含义 |
-a | –archive archive mode; equals -rlptgoD |
-r | –recursive 对子目录以递归模式处理 |
-l | 只传输链接文件 |
-p | –perms 保持文件权限 |
-t | –times 保持文件时间信息 |
-g | –group 保持文件属组信息 |
-o | –owner 保持文件属主信息 |
-D | –devices 保持设备文件信息 |
-v | –verbose 详细过程 |
-z | –compress 传输过程中压缩 |
-L | 传输链接文件,并将源文件中的内容放入链接文件中 |
-P | –partial 断点续传 |
-e | –rsh=command 指定使用rsh、ssh方式进行数据同步 |
–delete | 删除那些DST中SRC没有的文件 |
–bwlimit= limit | I/O bandwidth带宽限速 |
–exclude=PATTERN | 指定排除不需要传输的文件模式 |
–exclude-from=FILE | 排除FILE中指定模式的文件 |
–password-file=FILE | 从FILE中得到密码 |
无认证配置
uid = rsync
gid = rsync
port = 873
fake super = yes
use chroot = no
max connections = 200
timeout = 600
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
ignore errors
read only = true
list = true
[yum]
path = /usr/share/nginx/html
同步公网yum源
/usr/bin/rsync -zrLptgoDP --delete --exclude-from /usr/share/nginx/html/rsync_exclude.txt rsync://mirrors.tuna.tsinghua.edu.cn/centos/7 /usr/share/nginx/html/centos/
排除文件
排除文件
/usr/share/nginx/html/rsync_exclude.txt
atomic/
configmanagement/
cr/
cloud/
dotnet/
fasttrack/
isos/
nfv/
opstools/
paas/
rt/
sclo/
storage/
virt/
mail配置文件
配置文件位置/etc/mail.rc
set from=123456@qq.com
set smtp=smtps://smtp.qq.com:465
set smtp-auth-user=123456@qq.com
set smtp-auth-password=ihppxhssqsiqbfie#校验码
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/