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

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

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

介紹

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

常用場景

無密碼同步

服務(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é)

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

相關(guān)文章

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

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

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

    Apache Shiro 使用手冊(五) Shiro 配置說明

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

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

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

    linux下如何安裝nginx

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

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

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

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

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

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

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

    Linux信號機制之信號的保存與處理技巧分享

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

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

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

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

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

最新評論