centos 7.0+系统设置开机启动rsync服务
AndyYang|
阅读:100
发表时间:2026-03-11 16:11:43
linux
摘要:centos 7.0+系统设置开机启动rsync服务
之前都是在/etc/rc.local里面添加开机启动,新系统加了不生效,需要配置成systemctl服务
vim /etc/systemd/system/rsyncd.service
[Unit]
Description=Rsync Daemon
After=network.target
Wants=network.target
[Service]
ExecStart=/usr/bin/rsync --daemon --no-detach
Restart=always
User=root
# 可选:重定向日志
StandardOutput=syslog
StandardError=syslog
[Install]
WantedBy=multi-user.target
设置开机启动:
systemctl enable rsyncd
启动服务:
systemctl start rsyncd
已有0条评论