質問編集履歴
2
微修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -148,6 +148,6 @@
|
|
148
148
|
|
149
149
|
$ sudo crontab -l
|
150
150
|
|
151
|
-
* * * * * rsync -av --update --contimeout=60 rsync://10.0.1.1
|
151
|
+
* * * * * rsync -av --update --contimeout=60 rsync://10.0.1.100/test /var/www/test >/dev/null
|
152
152
|
|
153
153
|
```
|
1
情報を追加致しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -73,3 +73,81 @@
|
|
73
73
|
|
74
74
|
|
75
75
|
rsync version 3.0.6 protocol version 30
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
###追加情報
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
```
|
84
|
+
|
85
|
+
■設定ファイル
|
86
|
+
|
87
|
+
$ cat /etc/rsyncd.conf
|
88
|
+
|
89
|
+
uid = root
|
90
|
+
|
91
|
+
gid = root
|
92
|
+
|
93
|
+
read only = no
|
94
|
+
|
95
|
+
log file = /var/log/rsyncd.log
|
96
|
+
|
97
|
+
pid file = /var/run/rsyncd.pid
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
[{ディレクトリ}]
|
102
|
+
|
103
|
+
path = {パス}
|
104
|
+
|
105
|
+
hosts allow = localhost 10.0.1.0/24
|
106
|
+
|
107
|
+
hosts deny = *
|
108
|
+
|
109
|
+
read only = false
|
110
|
+
|
111
|
+
```
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
```
|
116
|
+
|
117
|
+
■rsync起動後、子プロセスが起動するのを確認
|
118
|
+
|
119
|
+
$ ps -eo lstart,ppid,pid,args | grep rsync
|
120
|
+
|
121
|
+
Fri Feb 10 09:57:13 2017 1 25506 /usr/bin/rsync --daemon --config=/etc/rsyncd.conf
|
122
|
+
|
123
|
+
Fri Feb 10 09:58:00 2017 25506 25542 /usr/bin/rsync --daemon --config=/etc/rsyncd.conf
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
■上記の後、netstatで確認
|
128
|
+
|
129
|
+
$ sudo netstat -anp | grep rsync
|
130
|
+
|
131
|
+
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN 25506/rsync
|
132
|
+
|
133
|
+
tcp 0 60 10.0.1.100:873 10.0.1.111:51177 ESTABLISHED 25542/rsync
|
134
|
+
|
135
|
+
tcp 0 0 :::873 :::* LISTEN 25506/rsync
|
136
|
+
|
137
|
+
※10.0.1.100は自身のプライペートIP、10.0.1.111が昔使ってたのサーバのプライペートIP
|
138
|
+
|
139
|
+
※なんで10.0.1.111が居るのだろう?
|
140
|
+
|
141
|
+
```
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
```
|
146
|
+
|
147
|
+
■外部サーバからcronでrsyncを実行
|
148
|
+
|
149
|
+
$ sudo crontab -l
|
150
|
+
|
151
|
+
* * * * * rsync -av --update --contimeout=60 rsync://10.0.1.138/test /var/www/test >/dev/null
|
152
|
+
|
153
|
+
```
|