欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Linux下rsync遠(yuǎn)程數(shù)據(jù)同步命令的詳細(xì)介紹

 更新時(shí)間:2017年02月20日 16:50:35   作者:ggjucheng  
rsync是一款開源的、快速的、多功能的、可實(shí)現(xiàn)全量及增量的本地或遠(yuǎn)程數(shù)據(jù)同步備份的優(yōu)秀工具。rsync軟件適用于unix/linux/windows等多種操作系統(tǒng)平臺(tái)。下面這篇文章主要介紹了Linux下rsync命令的相關(guān)資料,需要的朋友可以參考借鑒。

介紹

rsync命令是一個(gè)遠(yuǎn)程數(shù)據(jù)同步工具,可通過LAN/WAN快速同步多臺(tái)主機(jī)間的文件。rsync使用所謂的“rsync算法”來(lái)使本地和遠(yuǎn)程兩個(gè)主機(jī)之間的文件達(dá)到同步,這個(gè)算法只傳送兩個(gè)文件的不同部分,而不是每次都整份傳送,因此速度相當(dāng)快。 rsync是一個(gè)功能非常強(qiáng)大的工具,其命令也有很多功能特色選項(xiàng),我們下面就對(duì)它的選項(xiàng)一一進(jìn)行分析說(shuō)明。

常用場(chǎng)景

無(wú)密碼同步

服務(wù)端:vim /etc/rsyncd.conf

#This is the rsync daemon configuration 

#global settings 
pid file = /var/run/rsyncd.pid
port = 873
lock file = /var/run/rsyncd.lock
log file = /var/log/rsync.log
gid = root
uid = root

#module settings 
[share_data]
path = /web/rsync/share_data
use chroot = no
max connections = 15
read only = yes
write only = no
list = no
ignore errors = yes
timeout = 120
/usr/bin/rsync --daemon
mkdir -p /web/rsync/share_data

客戶端

rsync -avz --progress root@192.168.1.98::share_data /home/hadoop/share_data

限制流量同步

rsync -avz --bwlimit=50 --progress root@192.168.1.98::share_data /home/hadoop/share_data

有密碼同步

服務(wù)端 

vim /etc/rsyncd.conf

#This is the rsync daemon configuration 

#global settings 
pid file = /var/run/rsyncd.pid
port = 873
lock file = /var/run/rsyncd.lock
log file = /var/log/rsync.log
gid = root
uid = root

#module settings 
[auth_data]
path = /web/rsync/auth_data
use chroot = no
max connections = 15
read only = yes
write only = no
list = no
ignore errors = yes
timeout = 120
auth users = hadoop
secrets file = /etc/rsyncd.passwd
echo "hadoop:password123" > /etc/rsyncd.passwd 
chmod 600 /etc/rsyncd.passwd
mkdir -p /web/rsync/auth_data

客戶端

echo "password123" > /home/hadoop/rsyncd.passwd 
chmod 600 /home/hadoop/rsyncd.passwd 
rsync -avz --progress --password-file=/home/hadoop/rsyncd.passwd hadoop@192.168.1.98::auth_data /home/hadoop/auth_data

或者是

export RSYNC_PASSWORD="password123"
rsync -avz --progress hadoop@192.168.1.98::auth_data /home/hadoop/auth_data

寫入同步

服務(wù)端

vim /etc/rsyncd.conf

#global settings 
pid file = /var/run/rsyncd.pid
port = 873
lock file = /var/run/rsyncd.lock
log file = /var/log/rsync.log
gid = root
uid = root

#module settings 
[write_data]
path = /web/rsync/write_data
use chroot = no
max connections = 15
read only = no
list = no
ignore errors = yes
timeout = 120
auth users = hadoop
secrets file = /etc/rsyncd.passwd
mkdir -p /web/rsync/write_data

客戶端

echo "123" > /home/hadoop/write_file
export RSYNC_PASSWORD="password123"
rsync -avz --progress --delete /home/hadoop/write_file hadoop@192.168.1.98::write_data 

限定IP或者網(wǎng)段

#global settings 
pid file = /var/run/rsyncd.pid
port = 873
lock file = /var/run/rsyncd.lock
log file = /var/log/rsync.log
gid = root
uid = root

#module settings 
[write_data]
path = /web/rsync/write_data
use chroot = no
max connections = 15
read only = no
list = no
ignore errors = yes
timeout = 120
auth users = hadoop
secrets file = /etc/rsyncd.passwd
hosts allow = 192.168.2.32 192.168.1.0/24

客戶端 https://download.samba.org/pub/rsync/rsync.html

服務(wù)端 https://download.samba.org/pub/rsync/rsyncd.conf.html 

總結(jié)

以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,如果有疑問大家可以留言交流。謝謝大家對(duì)腳本之家的支持。

相關(guān)文章

  • linux下用time(NULL)函數(shù)和localtime()獲取當(dāng)前時(shí)間的方法

    linux下用time(NULL)函數(shù)和localtime()獲取當(dāng)前時(shí)間的方法

    這篇文章主要介紹了linux下用time(NULL)函數(shù)和localtime()獲取當(dāng)前時(shí)間的方法,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-02-02
  • Apache Shiro 使用手冊(cè)(五) Shiro 配置說(shuō)明

    Apache Shiro 使用手冊(cè)(五) Shiro 配置說(shuō)明

    這篇文章主要為大家分享了Apache Shiro 配置說(shuō)明,需要的朋友可以參考下
    2014-06-06
  • Linux echo文本處理命令的使用及示例

    Linux echo文本處理命令的使用及示例

    這篇文章主要介紹了Linux echo文本處理命令的使用及示例,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-03-03
  • linux下如何安裝nginx

    linux下如何安裝nginx

    這篇文章主要介紹了linux下如何安裝nginx問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-12-12
  • 詳解Linux搭建DNS服務(wù)器

    詳解Linux搭建DNS服務(wù)器

    這篇文章主要介紹了Linux搭建DNS服務(wù)器,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-04-04
  • Linux服務(wù)器從頭配置全過程

    Linux服務(wù)器從頭配置全過程

    這篇文章主要介紹了Linux服務(wù)器從頭配置全過程,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友參考下吧
    2024-03-03
  • Linux系統(tǒng)中安裝gcc和kernel-devel的方法

    Linux系統(tǒng)中安裝gcc和kernel-devel的方法

    下面小編就為大家?guī)?lái)一篇Linux系統(tǒng)中安裝gcc和kernel-devel的方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來(lái)看看吧
    2016-12-12
  • Linux信號(hào)機(jī)制之信號(hào)的保存與處理技巧分享

    Linux信號(hào)機(jī)制之信號(hào)的保存與處理技巧分享

    本文旨在為廣大Linux學(xué)習(xí)者提供一份詳盡而實(shí)用的指南,幫助他們深入理解Linux中的信號(hào)機(jī)制,掌握信號(hào)的保存與處理技巧,我們將從信號(hào)的基本概念出發(fā),逐步深入到信號(hào)的捕獲、保存、處理以及恢復(fù)等各個(gè)環(huán)節(jié),通過生動(dòng)的實(shí)例和詳細(xì)的解釋,讓讀者能夠輕松掌握
    2024-10-10
  • Linux服務(wù)器下安裝配置Nginx的教程

    Linux服務(wù)器下安裝配置Nginx的教程

    這篇文章主要介紹了Linux服務(wù)器下安裝配置Nginx服務(wù)器的教程,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2018-05-05
  • Linux 服務(wù)器安全技巧

    Linux 服務(wù)器安全技巧

    一臺(tái)服務(wù)器由大量功能各異的部件組成,這一點(diǎn)使得很難根據(jù)每個(gè)人的需求去提供定制的解決方案。這篇文章盡可能涵蓋一些有所裨益的小技巧來(lái)幫助管理員保證服務(wù)器和用戶安全
    2016-03-03

最新評(píng)論