inotify+rsync實現實時同步


1.1 什么是實時同步:如何實現實時同步

  1. 要利用監控服務(inotify),監控同步數據服務器目錄中信息的變化
  2. 發現目錄中數據產生變化,就利用rsync服務推送到備份服務器上

1.2 實現實時同步的方法

   inotify+rsync 方式實現數據同步

   sersync 方式實現實時數據同步 詳情參照:http://www.cnblogs.com/clsn/p/7707828.html

1.2.1 實時同步原理介紹

 

1.3 inotify+rsync 方式實現數據同步

1.3.1 Inotify簡介

  Inotify是一種強大的,細粒度的。異步的文件系統事件監控機制,linux內核從2.6.13起,加入了 Inotify支持,通過Inotify可以監控文件系統中添加、刪除,修改、移動等各種事件,利用這個內核接口,第三方軟件就可以監控文件系統下文件的各種變化情況,而 inotify-tools 正是實施這樣監控的軟件。國人周洋在金山公司也開發了類似的實時同步軟件sersync。

提示信息:

sersync軟件實際上就是在 inotify軟件基礎上進行開發的,功能要更加強大些 ,多了定時重傳機制,過濾機制了提供接口做 CDN,支持多線程橾作。

  Inotify實際是一種事件驅動機制,它為應用程序監控文件系統事件提供了實時響應事件的機制,而無須通過諸如cron等的輪詢機制來獲取事件。cron等機制不僅無法做到實時性,而且消耗大量系統資源。相比之下,inotify基於事件驅動,可以做到對事件處理的實時響應,也沒有輪詢造成的系統資源消耗,是非常自然的事件通知接口,也與自然世界事件機制相符合。

  inotify的實現有幾款軟件:

  inotify-tools,sersync,lrsyncd

1.3.2 inotify+rsync使用方式

  inotify 對同步數據目錄信息的監控

  rsync  完成對數據信息的實時同步

  利用腳本進行結合

1.4 部署inotify軟件的前提

  需要2.6.13以后內核版本才能支持inotify軟件。2.6.13內核之后版本,在沒有安裝inotify軟件之前,應該有這三個文件。

[root@backup ~]# ll /proc/sys/fs/inotify/
total 0
-rw-r--r-- 1 root root 0 Oct 17 10:12 max_queued_events
-rw-r--r-- 1 root root 0 Oct 17 10:12 max_user_instances
-rw-r--r-- 1 root root 0 Oct 17 10:12 max_user_watches

1.4.1 三個重要文件的說明 

文件

默認值

作用說明

max_user_watches

8192

設置inotifywaitinotifywatch命令可以監視的文件數量(單進程)

max_user_instances

128

設置每個用戶可以運行的inotifywaitinotifywatch命令的進程數

max_queued_events

16384

設置inotify實例事件(event)隊列可容納的事件數量

1.4.3 【官方說明】三個重要文件1.4.2 【服務優化】可以將三個文件的數值調大,監聽更大的范圍

[root@nfs01 ~]# man proc
/proc/sys/fs/inotify (since Linux 2.6.13)
       This   directory   contains    files    max_queued_events,
       max_user_instances, and max_user_watches, that can be used
       to limit the amount of kernel memory consumed by the  inotify interface.  
for further details, see inotify(7).

通過man手冊的第7級別中查到 inotify的默認文件的詳細說明。

[root@nfs01 ~]# man 7 inotify
/proc/sys/fs/inotify/max_queued_events
       The  value  in this file is used when an application calls
       inotify_init(2) to set an upper limit  on  the  number  of
       events  that  can  be  queued to the corresponding inotify
       instance.  Events in excess of this limit are dropped, but
       an IN_Q_OVERFLOW event is always generated.

/proc/sys/fs/inotify/max_user_instances
       This  specifies  an  upper  limit on the number of inotify
       instances that can be created per real user ID.

/proc/sys/fs/inotify/max_user_watches
       This specifies an upper limit on  the  number  of  watches
       that can be created per real user ID.

1.5 inotify軟件介紹及參數說明

1.5.1 兩種安裝方式

  1) yum install -y inotify-tools

  2) 手工編譯安裝

注:

    YUM 安裝需要有epel源

  http://mirrors.aliyun.com

手工編譯安裝方式需要到github上進行下載軟件包

    inotify軟件的參考資料鏈接:

  https://github.com/rvoicilas/inotify-tools/wiki

1.5.2 inotify主要安裝的兩個軟件

inotifywait(主要)

   在被監控的文件或目錄上等待特定文件系統事件(open close delete等)發生,執行后處於阻塞狀態,適合在shell腳本中使用

inotifywatch:

  收集被監控的文件系統使用的統計數據,指文件系統事件發生的次數統計。

  說明:在實時實時同步的時候,主要是利用inotifywait對目錄進行監控

1.5.3 inotifywait命令參數說明 

參數

含義

-m, --monitor

(重要參數)

Keep listening for events forever.  Without this option, inotifywait will exit after one event is received.

始終保持事件監聽。

-d, --daemon

111

-r, --recursive

(重要參數)

Watch all subdirectories of any directories passed as arguments.

遞歸監控目錄數據信息變化

-o, --outfile <file>

Print events to <file> rather than stdout.

打印事件到文件中,相當於標准正確輸出

-s, --syslog

Output errors to syslog(3) system log module rather than stderr.

發送錯誤到syslog相當於標准錯誤輸出

-q, --quiet

(重要參數)

If specified once, the program will be less verbose.  Specifically, it will not state  when  it  has  completed establishing all inotify watches.

輸出信息少(只打印事件信息)

--exclude <pattern>

Exclude all events on files matching the extended regular expression <pattern>.

排除文件或目錄

--excludei <pattern>

Like --exclude but case insensitive.

排除文件或目錄時,不區分大小寫

--timefmt <fmt>

(重要參數)

Print using a specified printf-like format string; read the man page for more details.

指定時間輸出格式

--format <fmt>

(重要參數)

Print using a specified printf-like formatstring; read the man page for more details.

打印使用指定的輸出類似格式字符串;即實際監控輸出內容

-e

(重要參數)

Listen for specific event(s).  If omitted, all events are listened for.

指定監聽指定的事件,如果省略,表示所有事件都進行監聽

以上的信息可以通過 inotifywait --help  獲得

1.5.4 -e[參數]  可以指定的事件類型 

事件名稱

事件說明

access

file or directory contents were read

文件或目錄內容被讀取

modify

file or directory contents were writterv

文件或目錄內容被寫入

attrib

file or directory attributes changed

文件或目錄屬性改變

close_write

(重要參數)

file or directory closed, after being opened in writeable mode.

文件或目錄關閉,在寫入模式打開之后關閉的。

close_nowrite

file or directory closed, after being opened in read-only mode.

文件或目錄關閉,在只讀模式打開之后關閉的

close

file or directory closed, regardless of read/write mode

文件或目錄關閉,不管讀或是寫模式

open

file or directory opened

文件或目錄被打開

moved_to

file or directory moved to watched directory

文件或目錄被移動到監控的目錄中

moved_from

file or directory moved from watched directory

文件或目錄被移動從監控的目錄中

move

(重要參數)

file or directory moved to or from watched directory

文件或目錄不管移動到或是移出監控目錄都觸發事件

create

(重要參數)

file or directory created within watched directory

文件或目錄創建在監控目錄中

delete

(重要參數)

file or directory deleted within watched directory

文件或目錄被刪除在監控目錄中

delete_self

file or directory was deleted

文件或目錄被刪除,目錄本身被刪除

unmount

file system containing file or directory unmounted

以上的信息可以通過 inotifywait --help  獲得

1.5.4.1  【實例】inotifywait監控中的事件測試

1、創建事件

[root@nfs01 data]# touch test2.txt
[root@nfs01 ~]# inotifywait -mrq  /data --timefmt "%d-%m-%y %H:%M" --format "%T %w%f 事件信息: %e" -e create
17-10-17 11:19 /data/test2.txt 事件信息: CREATE

2、刪除事件

[root@nfs01 data]# \rm -f test1.txt
[root@nfs01 ~]# inotifywait -mrq  /data --timefmt "%d-%m-%y %H:%M" --format "%T %w%f 事件信息: %e" -e delete
17-10-17 11:28 /data/test1.txt 事件信息: DELETE

3、修改事件

[root@nfs01 data]# echo "132" > test.txt
[root@nfs01 ~]# inotifywait -mrq  /data --timefmt "%d-%m-%y %H:%M" --format "%T %w%f 事件信息: %e" -e close_write
17-10-17 11:30 /data/test.txt 事件信息: CLOSE_WRITE,CLOSE

4、移動事件 moved_to

[root@nfs01 data]# mv /etc/hosts .
[root@nfs01 ~]# inotifywait -mrq  /data --timefmt "%d-%m-%y %H:%M" --format "%T %w%f 事件信息: %e" -e moved_to
17-10-17 11:33 /data/hosts 事件信息: MOVED_TO

5、移動事件 moved_from

[root@nfs01 data]# mv ./hosts  /tmp/
[root@nfs01 ~]# inotifywait -mrq  /data --timefmt "%d-%m-%y %H:%M" --format "%T %w%f 事件信息: %e" -e moved_from
17-10-17 11:34 /data/hosts 事件信息: MOVED_FROM

1.5.5 inotifywait 參數 --format <fmt>格式定義參數 

命令參數

參數說明

%w(重要參數)

事件出現時,監控文件或目錄的名稱信息

%f(重要參數)

事件出現時,將顯示監控目錄下觸發事件的文件或目錄信息,否則為空

%e(重要參數)

顯示發生的事件信息,不同的事件信息用逗號進行分隔

%Xe

顯示發生的事件信息,不同的事件信息有x進行分隔,可以修改X為指定分隔符

%T(重要參數)

輸出時間格式中定義的時間格式信息,通過 --timefmt option 語法格式指定時間信息

這個格式是通過strftime函數進行匹配時間格式信息的

以上的信息可以通過 inotifywait --help  獲得

1.5.6 inotifywait 參數--timefmt <fmt>時間格式參數

命令參數

參數說明

%d(重要參數)

The day of the month as a decimal number(range 01 to 31)

每月的第幾天,顯示倍息為十進制數(范圍是 01-31 )

%m(重要參數)

The month as a decimal number (range 01 to 12).

顯示月份,顯示信息為十進制(范圍 01-12 )

%M

The minute as a decimal number (range 00 to 59).

顯示分鍾,顯示信息為十進制(范圍 00-59 )

%y(重要參數)

The year as a decimal number without a century (range 00 to 99).

年份信息,顯示信息為十進制,並且沒有世紀信息

%Y

The year as a decimal number including the century.

年份信息,顯示信息為十進制,並且包含世紀信息

%H

The hour as a decimal number using a 24-hour clock (range 00 to 23).

小時信息,顯示信息為十進制,使用 24小時制(范圍 00-23 )

說明:以上信息可以通過 man strftime信息獲取

1.5.6.1  修改輸出的日期格式

[root@nfs01 ~]# inotifywait -mrq  /data --timefmt "%d/%m/%y %H:%M" --format "%T %w%f"
17/10/17 11:12 /data/test1.txt

1.5.7 -e[參數] 重要監控事件參數匯總表: 

重要事件

包含事件

備注說明

close

close_write  

close_nowrite

文件或目錄關閉,不管讀或是寫模式

即包含寫關閉與讀關閉

close_write

create

包含文件創建事件,但不包含目錄創建事件

move

moved_to  

moved_from

文件或目錄不管移動到或是移動出監控目錄都觸發事件

即包含信息移入或移出監控目錄事件

重要參數匯總:根據以上說明,在實際使用時,只要監控以下事件即可

create 創建、 delete 刪除、 movedjto 移入、 close_write

 inotifywait -mrq /data --format "%w%f" -e create,delete,moved_to,close_write 

1.6 對inotifywait命令的測試

對inotifywait命令測試的說明:

   需要打開兩個連接窗口

1窗口運行inotifywait

2窗口對文件夾進行操作,可在一窗口中查看出inotifywait的監控記錄

1.6.1 、創建文件的邏輯↓

[root@nfs01 ~]# inotifywait /data
Setting up watches.
Watches established.
/data/ CREATE test1.txt
/data/ OPEN test1.txt
/data/ ATTRIB test1.txt
/data/ CLOSE_WRITE,CLOSE test1.txt
創建文件,inotifywait顯示創建文件的過程↑
[root@nfs01 data]# touch test1.txt

1.6.2 創建目錄邏輯↓

[root@nfs01 data]# mkdir testdir
[root@nfs01 ~]#
/data/ CREATE,ISDIR testdir

1.6.3 監控子目錄下的文件↓

[root@nfs01 data]# touch  testdir/test01.txt
[root@nfs01 ~]# inotifywait -mrq  /data 
/data/testdir/ OPEN test01.txt
/data/testdir/ ATTRIB test01.txt
/data/testdir/ CLOSE_WRITE,CLOSE test01.txt

1.6.4 sed命令修改邏輯

[root@nfs01 data]# sed 's#132#123#g' test.txt -i

[root@nfs01 ~]# inotifywait -mrq  /data --timefmt "%d-%m-%y %H:%M" --format "%T %w%f 事件信息: %e" -e moved_from
 /data/test.txt 事件信息: OPEN
 /data/sedDh5R8v 事件信息: CREATE
 /data/sedDh5R8v 事件信息: OPEN
 /data/test.txt 事件信息: ACCESS
 /data/sedDh5R8v 事件信息: MODIFY
 /data/sedDh5R8v 事件信息: ATTRIB
 /data/sedDh5R8v 事件信息: ATTRIB
 /data/test.txt 事件信息: CLOSE_NOWRITE,CLOSE
 /data/sedDh5R8v 事件信息: CLOSE_WRITE,CLOSE
 /data/sedDh5R8v 事件信息: MOVED_FROM
 /data/test.txt 事件信息: MOVED_TO

sed命令替換邏輯

  01. 創建臨時文件

  02. 將原文件內容放置到臨時文件中,修改替換臨時文件中的內容,原有文件不做改動

  03. 重命名臨時文件,覆蓋原文件

1.6.5 inotifywait監控中 -e 的參數使用

inotifywait -mrq /data --timefmt "%d/%m/%y %H:%M" --format "%T %w%f 事件信息: %e" -e create

    說明:表示只監聽create事件

inotifywait -mrq /data --timefmt "%d/%m/%y %H:%M" --format "%T %w%f 事件信息: %e"

    說明:不指定-e參數,表示監聽所有事件

02. 刪除事件delete

    # inotifywait -mrq /data --timefmt "%F %H:%M" --format "%T %w%f 事件信息: %@e" -e delete
    2017-10-17 11:28 /data/02.txt 事件信息: DELETE
    2017-10-17 11:28 /data/03.txt 事件信息: DELETE
    2017-10-17 11:28 /data/04.txt 事件信息: DELETE

    03. 修改事件close_write

  # inotifywait -mrq /data --timefmt "%F %H:%M" --format "%T %w%f 事件信息: %@e" -e delete,close_write
    2017-10-17 11:30 /data/oldgirl.txt 事件信息: CLOSE_WRITE@CLOSE
    2017-10-17 11:30 /data/.oldgirl.txt.swx 事件信息: CLOSE_WRITE@CLOSE
    2017-10-17 11:30 /data/.oldgirl.txt.swx 事件信息: DELETE
    2017-10-17 11:30 /data/.oldgirl.txt.swp 事件信息: CLOSE_WRITE@CLOSE
    2017-10-17 11:30 /data/.oldgirl.txt.swp 事件信息: DELETE
    2017-10-17 11:30 /data/.oldgirl.txt.swp 事件信息: CLOSE_WRITE@CLOSE
    2017-10-17 11:30 /data/.oldgirl.txt.swp 事件信息: DELETE

    04. 移動事件moved_to

inotifywait -mrq /data --timefmt "%F %H:%M" --format "%T %w%f 事件信息: %@e" -e delete,close_write,moved_to
    2017-10-17 11:34 /data/hosts 事件信息: MOVED_TO

1.7 實時同步命令參數示意圖

 

第2章 inotify+rsync實時同步服務部署

2.1 第一個里程碑:部署rsync服務

2.1.1 rsync服務端部署

1)軟件是否存在

[root@backup ~]# rpm -qa |grep rsync
rsync-3.0.6-12.el6.x86_64

需求:查詢到某個命令非常有用。但是不知道屬於哪個軟件包

  yum provides rysnc

provides Find what package provides the given value 

2)進行軟件服務配置

[root@backup ~]# vim /etc/rsyncd.conf 
uid = rsync
gid = rsync
use chroot = no
max connections = 200
timeout = 300
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
ignore errors
read only = false
list = false
hosts allow = 172.16.1.0/24
auth users = rsync_backup
secrets file = /etc/rsync.password
[backup]
comment = "backup dir by oldboy"
path = /backup
[nfsbackup]
comment = "nfsbackup dir by hzs"
path = /nfsbackup

3)創建rsync管理用戶

[root@backup ~]# useradd -s /sbin/nologin -M rsync

4)創建數據備份儲存目錄,目錄修改屬主

[root@backup ~]# mkdir /nfsbackup/
[root@backup ~]# chown -R rsync.rsync /nfsbackup/

5)創建認證用戶密碼文件並進行授權600

echo "rsync_backup:clsn123" >>/etc/rsync.password
chmod 600 /etc/rsync.password

6)啟動rsync服務

rsync --daemon

至此服務端配置完成

[root@backup ~]# ps -ef |grep rsync 
root       2076      1  0 17:05 ?        00:00:00 rsync --daemon
root       2163   1817  0 17:38 pts/1    00:00:00 grep --color=auto rsync

2.1.2 rsync客戶端配置

1)軟件是否存在

[root@backup ~]# rpm -qa |grep rsync
rsync-3.0.6-12.el6.x86_64

2)創建安全認證文件,並進行修改權限600

echo "clsn123" >>/etc/rsync.password
chmod 600 /etc/rsync.password

3) 測試數據傳輸

[root@nfs01 sersync]# rsync -avz /data  rsync_backup@172.16.1.41::nfsbackup  --password-file=/etc/rsync.password
sending incremental file list
data/
data/.hzs
data/.tar.gz
data/.txt

2.2 第二個里程碑:部署inotify服務

首先先確認是否有epel用來安裝inotify-tools軟件

[root@nfs01 ~]# yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
repo id  repo name                                       status
base     CentOS-6 - Base - mirrors.aliyun.com             6,706
epel     Extra Packages for Enterprise Linux 6 - x86_64  12,401
extras   CentOS-6 - Extras - mirrors.aliyun.com              46
updates  CentOS-6 - Updates - mirrors.aliyun.com            722
repolist: 19,875

2.2.1 安裝inotify軟件

兩種安裝方式

  1) yum install -y inotify-tools

  2) 手工編譯安裝

注:

手工編譯安裝方式需要到github上進行下載軟件包

    inotify軟件的參考資料鏈接:

    https://github.com/rvoicilas/inotify-tools/wiki

2.2.2 查看inotify安裝上的兩個命令(inotifywait,inotifywatch)

[root@nfs01 ~]# rpm -ql inotify-tools
/usr/bin/inotifywait      #主要
/usr/bin/inotifywatch

2.2.2.1  inotifywait和inotifywatch的作用:

一共安裝了2個工具(命令),即inotifywait和inotifywatch

inotifywait : 在被監控的文件或目錄上等待特定文件系統事件(open close delete等)發生,

      執行后處於阻塞狀態,適合在shell腳本中使用

inotifywatch :收集被監控的文件系統使用的統計數據,指文件系統事件發生的次數統計。

  說明:yum安裝后可以直接使用,如果編譯安裝需要進入到相應軟件目錄的bin目錄下使用

#命令 man手冊說明
# man inotifywait
inotifywait - wait for changes to files using inotify

使用inotify進行監控,等待產生變化的文件信息

# man inotifywatch
inotifywatch - gather filesystem access statistics using inotify
使用inotify進行監控,收集文件系統訪問統計佶息

2.3 第三個里程碑:編寫腳本,實現rsync+inotify軟件功能結合

2.3.1 rsync服務命令:

rsync -avz --delete /data/ rsync_backup@172.16.1.41::nfsbackup --password-file=/etc/rsync.password

2.3.2 inotify服務命令:

inotifywait -mrq /data -format "%w%f"  -e create,delete,move_to,close_write

2.3.3 編寫腳本:

[root@nfs01 sersync]# vim /server/scripts/inotify.sh
#!/bin/bash
inotifywait -mrq /data --format "%w%f"  -e create,delete,moved_to,close_write|\
while read line
do
        rsync -az --delete /data/ rsync_backup@172.16.1.41::nfsbackup --password-
file=/etc/rsync.password
done

腳本說明:

  for循環會定義一個條件,當條件不滿足時停止循環

  while循環:只要條件滿足就一直循環下去

2.3.4 對腳本進行優化

#!/bin/bash

Path=/data
backup_Server=172.16.1.41

/usr/bin/inotifywait -mrq --format '%w%f' -e create,close_write,delete /data  | while read line  
do
    if [ -f $line ];then
        rsync -az $line --delete rsync_backup@$backup_Server::nfsbackup --password-file=/etc/rsync.password
    else
        cd $Path &&\
        rsync -az ./ --delete rsync_backup@$backup_Server::nfsbackup --password-file=/etc/rsync.password
    fi

done

2.4 第四個里程碑:測試編寫的腳本

2.4.1 讓腳本在后台運行

  在/data 目錄先創建6個文件

[root@nfs01 data]# sh  /server/scripts/inotify.sh &
[root@nfs01 data]# touch {1..6}.txt

在backup服務器上,已經時候同步過去了6個文件。

[root@backup ~]# ll /nfsbackup/
total 8
-rw-r--r-- 1 rsync rsync 0 Oct 17 12:06 1.txt
-rw-r--r-- 1 rsync rsync 0 Oct 17 12:06 2.txt
-rw-r--r-- 1 rsync rsync 0 Oct 17 12:06 3.txt
-rw-r--r-- 1 rsync rsync 0 Oct 17 12:06 4.txt
-rw-r--r-- 1 rsync rsync 0 Oct 17 12:06 5.txt
-rw-r--r-- 1 rsync rsync 0 Oct 17 12:06 6.txt

2.5 利用while循環語句編寫的腳本停止方法(kill)

  01. ctrl+z暫停程序運行,kill -9殺死

       02. 不要暫停程序,直接利用殺手三劍客進行殺進程

     說明:kill三個殺手不是萬能的,在進程暫停時,無法殺死;kill -9 (危險)

2.5.1 查看后台都要哪些程序在運行

[root@nfs01 data]# jobs
[1]+  Running                 sh /server/scripts/inotify.sh &

2.5.2 fg將后台的程序調到前台來

[root@nfs01 data]# fg 1
sh /server/scripts/inotify.sh

2.6 進程的前台和后台運行方法:

      fg    -- 前台

      bg    -- 后台

2.6.1 腳本后台運行方法

 01. sh inotify.sh &

 02. nohup sh inotify.sh &

 03. screen實現腳本程序后台運行 

sh /server/scripts/inotify.sh &
nohup
nohup sh inotify.sh &

2.7 screen實現腳本程序后台運行

2.7.1 經過yum查找發現screen命令屬於screen包

[root@test ~]# yum provides screen
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                      | 3.7 kB     00:00     
epel                                                      | 4.3 kB     00:00     
extras                                                    | 3.4 kB     00:00     
updates                                                   | 3.4 kB     00:00     
screen-4.0.3-19.el6.x86_64 : A screen manager that supports multiple logins on
                           : one terminal
Repo        : base
Matched from:

2.7.2 安裝screen軟件

[root@test ~]# yum install -y  screen

2.7.3 screen命令的參數

在shell中輸入 screen即可進入screen 視圖

[root@test ~]# screen

Screen實現后台運行程序的簡單步驟:

    screen -ls :可看screen會話

         screen +a d  :退出當前的screen,保持其后台運行

    screen -r ID :指定進入哪個screen會話

Screen命令中用到的快捷鍵

    Ctrl+a c :創建窗口

    Ctrl+a w :窗口列表

    Ctrl+a n :下一個窗口

    Ctrl+a p :上一個窗口

    Ctrl+a 0-9 :在第0個窗口和第9個窗口之間切換

    Ctrl+a K(大寫) :關閉當前窗口,並且切換到下一個窗口 ,

    (當退出最后一個窗口時,該終端自動終止,並且退回到原始shell狀態)

    exit :關閉當前窗口,並且切換到下一個窗口

    (當退出最后一個窗口時,該終端自動終止,並且退回到原始shell狀態)

    Ctrl+a d :退出當前終端,返回加載screen前的shell命令狀態

    Ctrl+a " : 窗口列表不同於w

提示信息:

sersync軟件實際上就是在 inotify軟件基礎上進行開發的,功能要更加強大些 ,多了定時重傳機制,過濾機制了提供接口做 CDN,支持多線程橾作。

  本文出自“慘綠少年”,歡迎轉載,轉載請注明出處!http://blog.znix.top

我的博客即將同步至騰訊雲+社區,邀請大家一同入駐。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM