Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2914

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

$
0
0

別ホストでアプリケーション(ここでは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

Viewing all articles
Browse latest Browse all 2914

Trending Articles