[[サーバーTips]] ** rsync [#b6780873] *** 実行 [#n19048d5] rsync -av --delete rsync://192.168.0.7/dsk1/ /mnt/dsk1 *** 設定 [#o5744de8] vi /etc/rsyncd.conf ## Rsync logging Settings #syslog facility = local5 #transfer logging = yes ## Global Settings uid = root gid = root log file = /var/log/rsyncd.log pid file = /var/run/rsyncd.pid dont compress = *.gz *.tgz *.zip *.pdf *.sit *.sitx *.lzh *.bz2 *.jpg *.jpeg *.gif *.png [dsk0] path = /mnt/dsk0 comment = comic files hosts allow = 192.168.0.7 hosts deny = * read only = no [dsk1] path = /mnt/dsk1 comment = media files hosts allow = 192.168.0.7 hosts deny = * read only = no [books] path = /mnt/dsk1/books comment = media files hosts allow = 192.168.0.7 hosts deny = * read only = no vi /etc/xinetd.d/rsync # default: off # description: The rsync server is a good addition to an ftp server, as it \ # allows crc checksumming etc. service rsync { disable = no flags = IPv6 socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID } /etc/rc.d/init.d/xinetd restart **Centos7 [#l4b801b7] [root@lyon sekigawa]# systemctl start rsyncd [root@lyon sekigawa]# systemctl enable rsyncd **スクリプト [#l4b801b7] #!/bin/bash rsync -av --delete rsync://192.168.0.7/dsk0/ /mnt/dsk0 rsync -av --delete rsync://192.168.0.7/dsk1/ /mnt/dsk1 rsync -av --delete rsync://192.168.0.7/dsk2/ /mnt/dsk2 **マシン内コピー [#l4b801b7] rsync -av --delete /mnt/dsk0/ /mnt/new_hdd/ **WAN経由 [#l4b801b7] rsync -avz --delete --bwlimit=8000 --partial --progress rsync://192.168.0.10/dsk0/ /mnt/dsk0