0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rsyncコマンドで設定ファイルの内容をコピーする

0
Posted at

別ホストでアプリケーション(ここではWEBサーバー)をインストールした際、設定ファイルを現状あるホストからコピーする

# rsyncをインストールする(両ホストにインストールされている必要あり)
 yum install rsync.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package rsync.x86_64 0:3.1.2-10.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch             Version                  Repository      Size
================================================================================
Installing:
 rsync           x86_64           3.1.2-10.el7             base           404 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 404 k
Installed size: 815 k
Is this ok [y/d/N]: y
Downloading packages:

rsync-3.1.2-10.el7.x86_64. 0% [                 ]  0.0 B/s |    0 B   --:-- ETA 

rsync-3.1.2-10.el7.x86_64.rpm                              | 404 kB   00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction

  Installing : rsync-3.1.2-10.el7.x86_64 [                                ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [##                              ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [####                            ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [#######                         ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [#########                       ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [############                    ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [##############                  ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [#################               ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [##################              ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [####################            ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [######################          ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [#########################       ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [##########################      ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [###########################     ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [############################    ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [#############################   ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64 [############################### ] 1/1
  Installing : rsync-3.1.2-10.el7.x86_64                                    1/1 

  Verifying  : rsync-3.1.2-10.el7.x86_64                                    1/1 

Installed:
  rsync.x86_64 0:3.1.2-10.el7                                                   

Complete!

#  設定ファイルをローカルからリモートへ差分コピー
rsync -v /etc/httpd/conf/httpd.conf root@172.16.0.11:/etc/httpd/conf/httpd.conf
root@172.16.0.11's password: 
httpd.conf

sent 156 bytes  received 143 bytes  54.36 bytes/sec
total size is 12,280  speedup is 41.07
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?