20190515

rsync & inotify

[server]

# yum install rsync -y
# cat /etc/rsyncd.conf
# cat /etc/rsyncd.pass
# mkdir /data/nextcloud
# systemctl restart rsync

[client]

# yum install rsync -y
# cat /etc/rsyncd.pass
# mkdir /data/192.168.56.103/
# getenforce
# rsync -vzrtopg --delete --progress --password-file=/etc/rsyncd.pass backup@192.168.56.103::nextcloud /data/192.168.56.103

[server]&[client]

需要注意的是防火牆有無關閉

# systemctl stop firewalld

[server]

# wget http://jensd.be/download/inotify-tools-3.14.tar.gz
# tar -xvzf inotify-tools-3.14. tar.gz
# cd /inotify-tools-3.14. tar.gz
./configure
make
makeinstall

[server]

# ssh-keygen
# cd .ssh/
# scp id_rsa.pub user@192.168.56.101:/tmp/authorized_keys

# ssh root@192.168.56.101
# rsync -avz /data/nextcloud root@192.168.56.101:/data/192.168.56.103
# cd 
# gedit rsync.sh
# chmod +x /rsync.sh
./rsync.sh

[client]

# cd .ssh/
# cp /tmp/authorized_keys .

Last updated