上課筆記
  • 20190227
  • 20190227
  • 20190306
  • 20190306
  • 20190313
  • 20190320
  • 20190327
  • 20190327
  • 20190327
  • 20190417
  • 20190424
  • 20190501
  • 20190508
  • 20190515
  • 20190529
  • 20190605
  • 20190917
  • 20190917
  • 20190924
  • 20191001
  • 20191001
  • 20191008
  • 20191008
  • 20191015
  • 20191015
  • 20191022
  • 20191022
  • 20191029
  • 20191029
  • 20191105
  • 20191105
  • 20191119
  • 20191119
  • 20191203
  • 20191203
  • 20191210
  • 20191217
  • 20191217
  • 20191224
  • 20191224
Powered by GitBook
On this page

Was this helpful?

20190515

rsync & inotify

Previous20190508Next20190529

Last updated 6 years ago

Was this helpful?

[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 .

架構
rsyncd.conf
rsyncd.pass
client拉資料備份
server端上傳資料
自動備份