zoukankan      html  css  js  c++  java
  • 一、rsync基础原理

    第1章 rsync 软件介绍

    1.1 什么是rsync

    rsync 是一款开源的、快速的、多功能的、可实现全量及增量的本地或远程数据同步备份的优秀工具。

    http://www.samba.org/ftp/rsync/rsync.html

    下载地址:https://download.samba.org/pub/rsync/

    1.1.1 全量及增量

    全量:将全部数据,进行传输覆盖

    增量:只传输差异部分的数据

    1.2 实现增量复制的原理

    Rsync通过其独特的“quick check”算法,实现增量传输数据

    [root@backup ~]#man rsync
    Rsync  finds  files  that  need  to  be transferred using a “quick check” algorithm (by default)  that  looks  for  files  that  have changed  in  size  or  in  last-modified time.  Any changes in the other preserved attributes (as requested by options) are  made  on the  destination file directly when the quick check indicates that the file’s data does not need to be updated.

    在同步备份数据时,默认情况下,Rsync通过其独特的“quick check”算法,它仅同步大小或者最后修改时间发生变化的文件或目录,当然也可根据权限,属主等属性的变化同步,但需要指定相应的参数,甚至可以实现只同步一个文件里有变化的内容部分,所以,可以实现快速的同步备份数据。

    centos 5 rsync 2.x 先比对再同步,速度较慢

    centos 6 rsync 3.x 一边比对,一边对差异部分进行同步

    1.2.1 软件版本

    [root@backup ~]# rsync --version
    rsync  version 3.0.6  protocol version 30
    Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
    Web site: http://rsync.samba.org/
    Capabilities:
        64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
        socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
        append, ACLs, xattrs, iconv, symtimes
    rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
    are welcome to redistribute it under certain conditions.  See the GNU
    General Public Licence for details.

    1.3 rsync 软件功能介绍

    类似于 cp 命令 -- 实现本地备份传输数据

    类似于scp 命令 -- 远程备份传输数据

    类似于 rm 命令 -- 实现无差异同步备份

    类似于 ls 命令 -- 本地文件信息查看

    rsync 命令属于1 v 4 的命令

    1.3.1 rsync == cp

    [root@backup ~]# cp -a  /etc/hosts /tmp/
    [root@backup ~]# ls /tmp/
    hosts
    [root@backup ~]# m /tmp/hosts
    [root@backup ~]# rsync  /etc/hosts /tmp/
    [root@backup ~]# ls /tmp/hosts
    /tmp/hosts

    1.3.2 rsync == scp

    #使用scp实现

    #检查对端服务器目标位置上是否有该文件

    [root@nfs01 ~]# ls /tmp/hosts
    ls: cannot access /tmp/hosts: No such file or directory

    #从本地拷贝到远端服务器上

    [root@backup ~]# ls /tmp/hosts
    /tmp/hosts
    [root@backup ~]# scp -rp /etc/hosts root@10.0.0.31:/tmp/
    The authenticity of host '10.0.0.31 (10.0.0.31)' can't be established.
    RSA key fingerprint is d3:41:bb:0d:43:88:da:a3:2c:e8:36:91:11:c9:e4:9c.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '10.0.0.31' (RSA) to the list of known hosts.
    root@10.0.0.31's password:
    hosts                                           100%  357     0.4KB/s   00:00

    #检查远端服务器上的结果

    [root@nfs01 ~]# ls /tmp/hosts
    /tmp/hosts

    #使用rsync 实现

    [root@backup ~]# rsync -rp /etc/hosts root@10.0.0.31:/tmp/
    root@10.0.0.31's password:
    [root@backup ~]#
    [root@nfs01 ~]# ls /tmp/hosts
    /tmp/hosts

    1.3.3 rsync == rm

    1.3.3.1 环境准备

    创建出来一次命令 进行操作

    [root@backup tmp]# mkdir /znix
    [root@backup znix]# cp /tmp/* .
    [root@backup znix]# ll
    total 4
    -rw-r--r-- 1 root root 357 Oct 11 15:21 hosts

    #rm命令操作

    [root@backup znix]# rm -rf /znix/hosts
    [root@backup znix]# ll /znix/hosts
    ls: cannot access /znix/hosts: No such file or directory

    查看这文件

    [root@backup ~]# l
    total 4
    -rw-r--r-- 1 root root 357 Oct 11 15:21 hosts

    创建一个空目录,使用空目录进行无差异同步

    [root@backup ~]# mkdir /null
    [root@backup ~]# rsync --delete  /null/ /znix/
    rsync: --delete does not work without -r or -d.
    rsync error: syntax or usage error (code 1) at main.c(1422) [client=3.0.6]
    [root@backup ~]# rsync  -a  --delete  /null/ /znix/
    [root@backup ~]# ll /znix/
    total 0

    1.3.4 rsync == ls -l

    使用rsync 可以实现与 ls 类似的功能

    [root@backup ~]# ls -l install.log
    -rw-r--r--. 1 root root 21736 Sep 25 08:38 install.log
    [root@backup ~]# rsync install.log
    -rw-r--r--       21736 2017/09/25 08:38:28 install.log

    1.4 Rsync的特性总结(7个特性信息说明)

    01. 支持拷贝普通文件与特殊文件如链接文件,设备等。
    02. 可以有排除指定文件或目录同步的功能,相当于打包命令tar的排除功能。
        #tar zcvf backup_1.tar.gz  /opt/data  --exclude=clsn  
        说明:在打包/opt/data时就排除了clsn命名的目录和文件。
    03. 可以做到保持原文件或目录的权限、时间、软硬链接、属主、组等所有属性均不改变-p。
    04. 可实现增量同步,既只同步发生变化的数据,因此数据传输效率很高(tar -N)。
        # 将备份/home 目录自 2008-01-29 以来修改过的文件
        # tar -N 2008-01-29 -zcvf /backups/inc-backup_$(date +%F).tar.gz /home
        # 将备份 /home 目录昨天以来修改过的文件
        # tar -N $(date -d yesterday "+%F") -zcvf /backups/inc-backup_$(date +%F).tar.gz /home
        # 添加文件到已经打包的文件
        # tar -rf all.tar *.gif
        说明:这条命令是将所有.gif的文件增加到all.tar的包里面去。-r是表示增加文件的意思。
    05. 可以使用rcp,rsh,ssh等方式来配合进行隧道加密传输文件(rsync本身不对数据加密)
    06. 可以通过socket(进程方式)传输文件和数据(服务端和客户端)*****。重点掌握
    07. 支持匿名的或认证(无需系统用户)的进程模式传输,可实现方便安全的进行数据备份及镜像。

    1.5 Rsync的企业工作场景说明

    1. 两台服务器之间数据同步(定时任务cron+rsync)

     同步网站内部人员数据信息(定时任务最小周期为1分钟)

    2. 两台服务器之间数据同步(实时任务inotify/sersync/lrsyncd+rsync)

     同步网站用户人员数据信息

    1.6Rsync的安装方式

    1、yum 安装

    yum install -y rsync

    2、源码安装rsync-3.0.7.tar.gz

    #下载rsync源码包

    mkdir /tools

    cd /tools

    wget -c https://download.samba.org/pub/rsync/src/rsync-3.0.7.tar.gz

    #源码安装部署

    tar -xzf  rsync-3.0.7.tar.gz

    cd rysnc-3.0.7

    ./configure –prefix=/usr/local/rsync

    make

    make install

    3、环境变量设置

    echo 'export PATH=/usr/local/rsync/bin:$PATH' >> /etc/profile

    source /etc/profile

    [root@yum rsync]# rsync --version

    rsync  version 3.0.7  protocol version 30

    Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.

    Web site: http://rsync.samba.org/

    Capabilities:

        64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,

        socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,

        append, no ACLs, xattrs, iconv, symtimes

    rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you

    are welcome to redistribute it under certain conditions.  See the GNU

    General Public Licence for details.

    第2章 rsync使用方式

    2.1 rsync软件工作方式

    SYNOPSIS
            本地数据同步方式
           Local:  rsync [OPTION...] SRC... [DEST]
            远程数据同步方式
           Access via remote shell:
             Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]
             Push: rsync [OPTION...] SRC... [USER@]HOST:DEST
            守护进程方式同步数据
           Access via rsync daemon:
             Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST]
                   rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]
             Push: rsync [OPTION...] SRC... [USER@]HOST::DEST
                   rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST

    2.1.1 本地数据同步方式(类似于cp)

    Local:  rsync [OPTION...] SRC... [DEST]

    参数

    含义

    rsync

    数据同步命令

    [OPTION...]

    rsync命令参数信息

    SRC

    要同步的数据信息(文件或目录)

    [DEST]

    将数据传输到什么位置

    2.1.1.1 实例演示命令:

    [root@backup ~]# rsync  /etc/hosts /tmp/
    [root@backup ~]# ls /tmp/hosts
    /tmp/hosts

    2.1.2 远程数据同步方式(类似scp)---又称为隧道传输

    Access via remote shell:
      Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]
      Push: rsync [OPTION...] SRC... [USER@]HOST:DEST

    说明:需要进行交互传输数据。如果想实现免交互传输数据,需要借助ssh+key方式实现

    pull**:** 拉:

     

    [USER@]

    以什么用户身份传输数据信息

    HOST:

    远程主机信息(IP地址信息 主机名称信息)

    SRC:

    远端要拉过来的数据信息

    [dest]

    拉到本地什么位置

    push**:推:**

     

    SRC**:**

    本地要推过去的数据信息

    DEST

    推到远端什么位置

    2.1.3 【实践操作】pull 拉

    从远端拉文件到当前目录

    [root@nfs01 ~]# touch /tmp/1.txt
    [root@backup ~]# rsync nfs01:/tmp/1.txt .
    root@nfs01's password:
    [root@backup ~]# ll
    total 44
    -rw-r--r--  1 root root     0 Oct 11 16:16 1.txt

    2.1.4 【实践操作】push 推 (目录)

    将本地的hosts文件推到远端服务器上

    [root@backup tmp]# ll
    total 4
    -rw-r--r-- 1 root root 357 Oct 11 15:12 hosts

    使用push的格式 推整个目录(包括目录)

    [root@backup tmp]# rsync -r /tmp nfs01:/tmp/
    root@nfs01's password:
    [root@nfs01 tmp]# ll
    total 4
    drwxr-xr-x 3 root root 4096 Oct 11 16:20 tmp

    推整个目录下的文件(不包括目录本身)

    [root@backup tmp]# rsync -r /tmp/ nfs01:/tmp/
    root@nfs01's password:
    [root@nfs01 tmp]# ll
    total 8
    -rw-r--r-- 1 root root  357 Oct 11 16:21 hosts
    drwxr-xr-x 3 root root 4096 Oct 11 16:20 tmp

    说明:

    /tmp --表示将tmp目录本身及目录下的内容进行传输

    /tmp/ --表示只传输tmp目录下面的内容信息

    2.2 守护进程方式同步数据

    [root@localhost ~]# uname -a
    Linux 2.6.32-696.el6.x86_64 #1 SMP Tue Mar 21 19:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
    Access via rsync daemon:
    Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST]
          rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]
    Push: rsync [OPTION...] SRC... [USER@]HOST::DEST
          rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST

    2.2.1 配置rsync守护进程方式(需要有服务端与客户端)

    规划:

    1、backup服务器作为rsync服务端

     2、以rysnc客户端作为参照物,将数据推到rsync服务器上

    2.2.2 配置rsync服务端(将服务端配置到 backup 服务器上)

    第一个里程碑: 软件是否存在

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

    第二个里程碑: 进行软件服务配置

    [root@backup ~]# vim /etc/rsyncd.conf

    #port=873      #默认的监听端口为873,可修改
    #address=192.168.0.10  #可以定义绑定的ip
    uid = rsync    #以那个用户的身份来传输
    gid = rsync    #以那个组身份来传输
    use chroot = no #是否限定在该目录下,默认为true,当有软连接时,需要改为fasle,如果为true就限定为模块默认目录
    max connections = 200 #最大链接数量
    timeout = 300 #超时时间
    pid file = /var/run/rsyncd.pid  #指定PID
    lock file = /var/run/rsync.lock #配合最大链接数,超过最大链接数后,还有的备份需要等待前面的完成后,再备份。
    log file = /var/log/rsyncd.log  #指定日志文件
    ignore errors #忽略磁盘IO读写错误
    read only = false #是否为只读,如果是yes的话,客服端推送给服务端的时候不成功,这时候要改成no
    list = false  ##是否可以列出模块名    rsync --port 8730   172.16.37.139::  如果为yes的话会列出客户端所有               ##的模块名字。 
    hosts allow = 172.16.1.0/24 #设置可以允许访问的主机,可以是网段,多个Ip地址用空格隔开
    hosts deny = 0.0.0.0/32 #设置不允许访问的主机
    auth users = rsync_backup #指定验证用户名,可以不设置,不设置默认不用密码,设置的话安全性更高点
    secrets file = /etc/rsync.password #指定密码文件,如果设定验证用户,这一项必须设置,设定密码权限为600.

    ###以上部分为全局配置部分,以下为模块内的设置(全局的内容也可以配置到模块下,生效顺序是先模块内再全局)
    [backup] #为模块名,自定义
    comment = "backup dir by clsn" #注释说明
    path = /backup # 指定该模块对应在哪个目录下

     

    第三个里程:创建rsync用户

    [root@backup ~]# id rsync
    id: rsync: No such user
    [root@backup ~]# useradd -s /sbin/nologin -M rsync

    第四个里程碑: 创建数据备份储存目录,目录修改属主

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

    第五个里程碑: 创建认证用户密码文件

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

    第六个里程碑: 启动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
    [root@backup ~]# netstat -lntup |grep rsync
    tcp        0      0 0.0.0.0:873                 0.0.0.0:*                   LISTEN      2076/rsync        
    tcp        0      0 :::873                      :::*                        LISTEN      2076/rsync 

     

    2.2.3 配置rsync客户端(其他服务器为客户端)

    第一个里程碑: 软件是否存在

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

    第二个里程碑: 创建认证文件

     客户端的认证文件只需要有密码即可

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

    第三个里程碑: 实现数据传输

    交互式

    [root@nfs01 ~]# rsync -avzP /etc/hosts rsync_backup@172.16.1.41::backup
    Password:
    sending incremental file list
    hosts
             357 100%    0.00kB/s    0:00:00 (xfer#1, to-check=0/1)
     
    sent 63 bytes  received 33 bytes  9.14 bytes/sec
    total size is 357  speedup is 3.72

    免交互式

    [root@nfs01 ~]# rsync -avzP /etc/hosts rsync_backup@172.16.1.41::backup --password-file=/etc/rsync.password
    sending incremental file list
    hosts
             357 100%    0.00kB/s    0:00:00 (xfer#1, to-check=0/1)
     
    sent 199 bytes  received 27 bytes  150.67 bytes/sec
    total size is 357  speedup is 1.58

    让目标目录SRC和源目录数据DST一致,即无差异数据同步--delete

    [root@nfs01 ~]# rsync -avzP --delete /etc/hosts rsync_backup@172.16.1.41::backup --password-file=/etc/rsync.password

    2.3 rsync守护进程传输数据原理

    2.4 rsync 命令同步参数选项&特殊参数

    目录参数

    参数说明

    -v ,--verbose

    详细模式输出,传输时的信息

    -z,--compress

    传输时进行压缩以提高传输效率--compress-level=NUM 可按级别压缩局域网可以不用压缩

    -a,--archive (主要)

    归档模式,表示以递归方式传输文件,并保持文件属性。等于 -rtopgDl

    -r,--recursive 归档于-a

    对子目录以递归模式,即目录下的所有目录都同样传输。小写r

    -t,--times 归档于-a

    保持文件时间信息

    -o,--owner 归档于-a

    保持文件属主信息

    -p,--perms 归档于-a

    保持文件权限

    -g,--group 归档于-a

    保持文件属组信息

    -P,--progress

    显示同步的过程及传输时的进度等信息(大P)

    -D,--devices 归档于-a

    保持设备文件信息

    -l,--links 归档于-a

    保留软连接(小写字母l)

    -e,--rsh=COMMAND

    使用的信道协议(remote shell),指定替代rsh的shell程序。例如 ssh

    --exclude=PATTERN

    指定排除不需要传输的文件信息

    --exclude-from=file

    文件名所在目录文件,即可以实现排除多个文件

    --bwlimit=RATE

    限速功能

    --delete

    让目标目录SRC和源目录数据DST一致,即无差异数据同步

    保持同步目录及文件属性:这里的-avzP相当于 -vzetopdDlP,生产环境常用的参数为 -avzP在脚本中可以报-vP去掉--progress可以用-P代替

     

    daemon**启动扩展参数**

     

    --daemon

    daemon表示以守护进程的方式启动rsync服务。

    --address

    绑定指定IP地址提供服务。

    --config=FILE

    更改配置文件路径,而不是默认的/etc/rsyncd.conf

    --port=PORT

    更改其它端口提供服务,而不是缺省的873端口

    2.4.1 特殊参数实践

    指定ip:

    [root@backup ~]# rsync --daemon --address=172.16.1.41
    [root@backup ~]# netstat -lntup |grep 873
    tcp     0   0 172.16.1.41:873     0.0.0.0:*        LISTEN      2583/rsync     
    参数测试:
    [root@nfs01 ~]# rsync -avzP /etc/services rsync_backup@172.16.1.41::backup --password-file=/etc/rsync.password
    sending incremental file list
    services
          641020 100%   19.34MB/s    0:00:00 (xfer#1, to-check=0/1)
     
    sent 127417 bytes  received 27 bytes  254888.00 bytes/sec
    total size is 641020  speedup is 5.03

    指定配置文件路径

    [root@backup ~]# rsync --daemon --config=/etc/rsyncd.conf
    [root@nfs01 ~]# rsync -avzP /etc/services rsync_backup@172.16.1.41::backup --password-file=/etc/rsync.password
    sending incremental file list
    sent 29 bytes  received 8 bytes  74.00 bytes/sec
    total size is 641020  speedup is 17324.86

    服务端指定服务端口:

    [root@backup ~]# rsync --daemon --port=5222
    [root@backup ~]# netstat -lntup|grep rsync
    tcp        0      0 0.0.0.0:5222      0.0.0.0:*           LISTEN      2598/rsync        
    tcp        0      0 :::5222            :::*                 LISTEN      2598/rsync     

    第3章 rsycn配置文件详解 rsyncd.conf

    3.1 部分知识补充

    3.1.1 配置文件内容参考资料

    man rsyncd.conf

    3.1.2 配置文件内容总结

     模块之上内容为全局变量信息

     模块之下内容为局部变量信息

    说明:

    无论是全局变量发生变化,还是局部变量发生变化,都建议重启rsync服务使配置生效。

    3.2 利用/etc/init.d/启动rsync服务方式

    3.2.1 可以实现方式:

    a. 编写rsync启动脚本(有一定的shell能力 if case)
    b. 利用xinetd服务,管理启动rsync服务

    3.2.2 利用 xinetd服务 管理rsync

    第一个里程碑: 安装xinetd软件

    [root@backup ~]# yum install -y xinetd
    [root@backup ~]# rpm -qa |grep xin
    xinetd-2.3.14-40.el6.x86_64

    第二个里程碑:编辑配置文件

     修改disable = yes 改为disable = no

    [root@backup ~]# vim /etc/xinetd.d/rsync
    # default: off
    # description: The rsync server is a good addition to an ftp server, as it
    #   allows crc checksumming etc.
    service rsync
    {
    disable   = no
    flags     = IPv6
    socket_type     = stream
    wait            = no
    user            = root
    server          = /usr/bin/rsync
    server_args     = --daemon
    log_on_failure  += USERID
    }

    第三个里程碑:重启xinetd服务

    [root@backup ~]# /etc/init.d/xinetd restart
    Stopping xinetd:                                           [  OK  ]
    Starting xinetd:                                           [  OK  ]

    传输测试

    [root@nfs01 ~]# rsync -avzP /etc/services rsync_backup@172.16.1.41::backup --password-file=/etc/rsync.password
    sending incremental file list
    sent 29 bytes  received 8 bytes  74.00 bytes/sec
    total size is 641020  speedup is 17324.86

    3.3 定义变量信息实现免秘钥交互

    3.3.1 通过man手册获得方法

    Some  modules  on the remote daemon may require authentication. If so, you will receive a password prompt when you connect.  You  can avoid  the  password  prompt  by  setting the environment variable RSYNC_PASSWORD to the password  you  want  to  use  or  using  the --password-file option. This may be useful when scripting rsync.
    WARNING:  On some systems environment variables are visible to all users. On those systems using --password-file is recommended.

    在远程进程的一些模块可能需要认证。如果是这样的话,你将得到一个密码提示当您连接。你可以通过设置环境变量rsync_password要使用或使用密码文件选项密码避免密码提示。这可能是有用的脚本文件。

    警告:在一些系统环境变量,对所有用户都是可见的。在这些系统中使用的密码文件的建议。

    3.3.2 使用 RSYNC_PASSWORD 变量实现免交互

    未设置变量之前

    [root@nfs01 ~]# rsync -avzP /etc/services rsync_backup@172.16.1.41::backup
    Password:

    添加上环境变量

    [root@nfs01 ~]# export RSYNC_PASSWORD=clsn123

    测试

    [root@nfs01 ~]# rsync -avzP /etc/services rsync_backup@172.16.1.41::backup
    sending incremental file list
    sent 29 bytes  received 8 bytes  24.67 bytes/sec
    total size is 641020  speedup is 17324.86

    3.4 守护进程多模块功能配置

    第一个里程碑: 编写配置信息创建多模块

    [root@backup ~]# vim /etc/rsyncd.conf
    ……
    [nfsdata]
    comment = "nfsdata dir by clsn"
    path = /backup/nfsdata
    [nfsbackup]
    comment = "nfsbackup dir by clsn"
    path = /backup/nfsbackup

    第二个里程碑: 创建多模块指定的目录

    # 创建目录,并修改目录的权限
    [root@backup ~]# mkdir /backup/nfs{data,backup} -p
    [root@backup ~]# chown rsync.rsync  /backup/nfs{data,backup}
    #查看:
    [root@backup ~]# ll /backup/nfs{data,backup} -d
    drwxr-xr-x 2 rsync rsync 4096 Oct 12 10:05 /backup/nfsbackup
    drwxr-xr-x 2 rsync rsync 4096 Oct 12 10:05 /backup/nfsdata

    第三里程碑: 利用rsync客户端进行测试

    [root@nfs01 ~]# rsync -avz /data/ rsync_backup@172.16.1.41::nfsdata --password-file=/etc/rsync.passsword
    sending incremental file list
    ./
    nfs.data
    sent 78 bytes  received 30 bytes  216.00 bytes/sec
    total size is 0  speedup is 0.00

    说明:

    rsyncd.conf配置文件中,添加多模块信息,可以不用重启rsync服务,即时生效~

    全局变量参数针对所有模块生效;局部变量参数只针对指定模块生效

    read only参数默认配置为ture,即为只读模式

    全局变量发生变化,不用重启rsync服务;局部变量发生变化,需要重启rsync服务

    注意:修改配置文件就重启

    无论是全局变量发生变化,还是局部变量发生变化,都建议重启rsync服务使配置生效

    3.5 守护进程的排除功能实践

    3.5.1 排除的方式

    a) --exclude=要配置的目录或文件名称

     b) --exclude-from=要排除多个目录或文件汇总文件名称

     c) 在配置文件中进行修改,指定要排除的信息

    3.5.2 排除测试

    第一个里程碑: 创建模拟测试环境

    [root@nfs01 data]# mkdir {a..d}
    [root@nfs01 data]# touch {a..d}/{1..3}.txt
    [root@nfs01 data]# tree
    .
    ├── a
    │   ├── 1.txt
    │   ├── 2.txt
    │   └── 3.txt
    ├── b
    │   ├── 1.txt
    │   ├── 2.txt
    │   └── 3.txt
    ├── c
    │   ├── 1.txt
    │   ├── 2.txt
    │   └── 3.txt
    └── d
        ├── 1.txt
        ├── 2.txt
        └── 3.txt
    4 directories, 12 files

    第二个里程碑 利用 --exclude参数测试排除功能

    # 需求:不要a目录中3.txt 不要b、c目录
    [root@nfs01 data]# rsync -avz /data/ --exclude=a/3.txt --exclude=b --exclude=c rsync_backup@172.16.1.41::nfsdata
    sending incremental file list
    ./
    a/
    a/1.txt
    a/2.txt
    d/
    d/1.txt
    d/2.txt
    d/3.txt
    sent 300 bytes  received 114 bytes  828.00 bytes/sec
    total size is 0  speedup is 0.00

    精简方式排除

    [root@nfs01 data]# rsync -avz /data/ --exclude=a/3.txt --exclude={b,c} rsync_backup@172.16.1.41::nfsdata
    sending incremental file list
    ./
    a/
    a/1.txt
    a/2.txt
    d/
    d/1.txt
    d/2.txt
    d/3.txt
    sent 300 bytes  received 114 bytes  828.00 bytes/sec
    total size is 0  speedup is 0.00

    3.5.3 利用--exclude-from 方式进行排除

    第一个里程碑: 创建模拟测试环境

    [root@nfs01 data]# mkdir {a..d}
    [root@nfs01 data]# touch {a..d}/{1..3}.txt

    第二个里程碑:利用--exlude-from参数,测试排除功能

    [root@nfs01 data]# vim /tmp/paichu.txt
    a/3.txt
    b
    c

    第三个里程碑:进行排除

    [root@nfs01 data]# rsync -avz /data/ --exclude-from=/tmp/paichu.txt rsync_backup@172.16.1.41::nfsdata
    sending incremental file list
    ./
    a/
    a/1.txt
    a/2.txt
    d/
    d/1.txt
    d/2.txt
    d/3.txt
    sent 300 bytes  received 114 bytes  828.00 bytes/sec
    total size is 0  speedup is 0.00

    说明:

    1. 排除文件中,需要利用相对路径指定排除信息(不能利用绝对路径)

    2. 相对路径指的是相对同步的目录信息而言,是对rsync -avz /data/ 后面的data目录进行相对

    3.5.4 在配置文件中修改要排除的文件

    第一个里程碑: 编写修改服务端配置文件

    vim /etc/rsyncd.conf
    [nfsdata]
    comment = "nfsdata dir by clsn"
    path = /backup/nfsdata
    exclude=a/3.txt b c

    第二个里程碑:重启rsync服务

    killall rsync && sleep 1 && rsync --daemon

    第三里程碑: 进行测试

    [root@nfs01 data]# rsync -avz /data/  rsync_backup@172.16.1.41::nfsdata
    sending incremental file list
    ./
    a/
    a/1.txt
    a/2.txt
    skipping daemon-excluded file "a/3.txt"
    skipping daemon-excluded directory "b"
    *** Skipping any contents from this failed directory ***
    skipping daemon-excluded directory "c"
    *** Skipping any contents from this failed directory ***
    d/
    d/1.txt
    d/2.txt
    d/3.txt
    sent 407 bytes  received 116 bytes  1046.00 bytes/sec
    total size is 0  speedup is 0.00
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]

    3.6 守护进程来创建备份目录

    通过客户端命令创建服务端备份目录中子目录

    # 推送/etc/services文件到 服务器/backup/sda/目录
    [root@nfs01 ~]# rsync -avzP /etc/services rsync_backup@172.16.1.41::backup/dba/
    sending incremental file list
    created directory dba
    services
          641020 100%   19.34MB/s    0:00:00 (xfer#1, to-check=0/1)
    # 推送/etc/services文件到 服务器/backup/sa/目录
    sent 127417 bytes  received 27 bytes  254888.00 bytes/sec
    total size is 641020  speedup is 5.03
    [root@nfs01 ~]# rsync -avzP /etc/services rsync_backup@172.16.1.41::backup/sa/
    sending incremental file list
    created directory sa
    services
          641020 100%   19.34MB/s    0:00:00 (xfer#1, to-check=0/1)
    # 推送/etc/services文件到 服务器/backup/dev/目录
    sent 127417 bytes  received 27 bytes  254888.00 bytes/sec
    total size is 641020  speedup is 5.03
    [root@nfs01 ~]# rsync -avzP /etc/services rsync_backup@172.16.1.41::backup/dev/
    sending incremental file list
    created directory dev
    services
          641020 100%   18.71MB/s    0:00:00 (xfer#1, to-check=0/1)
     
    sent 127417 bytes  received 27 bytes  254888.00 bytes/sec
    total size is 641020  speedup is 5.03

    检查结果:

    [root@backup backup]# tree
    .
    ├── dba
    │   └── services
    ├── dev
    │   └── services
    └── sa
        └── services

    说明:

    a 目标目录名称后要加上 "/", 表示创建目录,否则变为修改传输文件名称了

    b 利用客户端创建服务备份子目录时,只能创建一级子目录。

    3.7 守护进程的访问控制配置

    第一个里程碑:在服务端配置文件,编写白名单策略或黑名单策略(只能取其一)

        vim /etc/rsyncd.conf
        hosts allow = 172.16.1.0/24
        #hosts deny = 0.0.0.0/32

    关于访问控制的说明:

    1. 白名单和黑名单同时存在时,默认控制策略为不匹配的传输数据信息全部放行

     2. 白名单单一存在时,默认控制策略为不匹配的传输数据信息全部禁止

     3. 黑名单单一存在时,默认控制策略为不匹配的传输数据信息全部放行

     全局变量修改控制策略信息,rsync**服务必须重启**

    第二个里程碑:客户端进行测试

        [root@nfs01 backup]# rsync -avz /etc/services rsync_backup@10.0.0.41::data
        @ERROR: Unknown module 'data'
        rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]
    --------------------------------------------------------------------------------
        [root@nfs01 backup]# rsync -avz /etc/services sync_backup@172.16.1.41::data
        sending incremental file list
        sent 29 bytes  received 8 bytes  74.00 bytes/sec
        total size is 641020  speedup is 17324.86

    3.8 守护进程无差异同步配置

    3.8.1 什么是无差异:

     推模式:我有什么,你就有什么;我没有,你也不能有

     拉模式:你有什么,我就有什么;你没有,我也不能有

     总结:服务端客户端数据完全一致(一模一样)

    3.8.2 实现无差异同步方法

    第一个里程碑: 创建实验环境

    [root@nfs01 ~]# ll /data/
    total 16
    drwxr-xr-x 2 root root 4096 Oct 12 10:29 a
    drwxr-xr-x 2 root root 4096 Oct 12 10:40 b
    drwxr-xr-x 2 root root 4096 Oct 12 10:29 c
    drwxr-xr-x 2 root root 4096 Oct 12 10:29 d

    第二个里程:进行第一次数据同步

    [root@nfs01 ~]# rsync -avz --delete  /data/ rsync_backup@172.16.1.41::backup/
    sending incremental file list
    ./
    a/
    a/1.txt
    a/2.txt
    a/3.txt
    b/
    b/1.txt
    b/2.txt
    b/3.txt
    c/
    c/1.txt
    c/2.txt
    c/3.txt
    d/
    d/1.txt
    d/2.txt
    d/3.txt
    sent 669 bytes  received 255 bytes  1848.00 bytes/sec
    total size is 0  speedup is 0.00

    第三个里程:删除指定目录,并添加指定文件,测试无差异功能

    # 删除客户端中的 a/ 目录,再进行无差异传输
    [root@nfs01 data]# rm a/ -rf
    [root@nfs01 data]# rsync -avz --delete  /data/ rsync_backup@172.16.1.41::backup/
    sending incremental file list
    ./
    deleting a/3.txt
    deleting a/2.txt
    deleting a/1.txt
    deleting a/
    sent 181 bytes  received 14 bytes  390.00 bytes/sec
    total size is 0  speedup is 0.00

    3.8.3 【注意】无差异同步方法的应用

    1. 实现储存数据与备份数据完全一致(慎用

      rsync -avz --delete  /data/ rsync_backup@172.16.1.41::backup /

    2. 快速删除大文件数据

      1.mkdir /null      --创建出一个空目录。
      2.rsync -avz --delete /null/ /bigdata/
      # 删除效率高于 rm -rf /bigdata

    3.9 守护进程的列表功能配置

    第一个里程碑: 在服务端配置文件中开启list列表功能

    [root@backup ~]# vim /etc/rsyncd.conf
    list = true

    第二个里程碑:重启rsync服务

    [root@backup ~]# killall rsync && sleep 1 && rsync --daemon

    第三个里程碑: 客户端查看服务端模块信息

    [root@nfs01 data]# rsync rsync_backup@172.16.1.41::
    backup         "backup dir by clsn"
    nfsdata        "nfsdata dir by clsn"
    nfsbackup      "nfsbackup dir by clsn"

    说明:

    为了提升备份服务器安全性,建议关闭list列表功能

    第4章 Rsync服务常见问题汇总讲解:

    [root@nfs01 tmp]# rsync -avz /etc/hosts  rsync_backup@172.16.1.41::backup
    Password:
    sending incremental file list
    hosts
    rsync: mkstemp ".hosts.U5OCyR" (in backup) failed: Permission denied (13)
    sent 200 bytes  received 27 bytes  13.76 bytes/sec
    total size is 371  speedup is 1.63
    rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]

    说明:备份目录权限设置不正确

    解决办法:

     将服务端的备份存放目录(path值),属主和属组修改为rsync。

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

    ==================================

    1. rsync服务端开启的iptables防火墙 【客户端的错误】  No route to host 【错误演示过程】  [root@nfs01 tmp]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::backup  rsync: failed to connect to 172.16.1.41: No route to host (113)  rsync error: error in socket IO (code 10) at clientserver.c(124) [sender=3.0.6] 【异常问题解决】  关闭rsync服务端的防火墙服务(iptables)  [root@backup mnt]# /etc/init.d/iptables stop  iptables: Setting chains to policy ACCEPT: filter [ OK ]  iptables: Flushing firewall rules: [ OK ]  iptables: Unloading modules: [ OK ]  [root@backup mnt]# /etc/init.d/iptables status  iptables: Firewall is not running.
    2. rsync客户端执行rsync命令错误 【客户端的错误】  The remote path must start with a module name not a /  【错误演示过程】  [root@nfs01 tmp]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::/backup  ERROR: The remote path must start with a module name not a /  rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6] 【异常问题解决】  rsync命令语法理解错误,::/backup是错误的语法,应该为::backup(rsync模块)
    3. rsync服务认证用户失败* 【客户端的错误】  auth failed on module oldboy 【错误演示过程】  [root@nfs01 tmp]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::backup  Password:   @ERROR: auth failed on module backup  rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6] 【异常问题解决】
      1. 密码真的输入错误,用户名真的错误
      2. secrets file = /etc/rsync.password指定的密码文件和实际密码文件名称不一致
      3. /etc/rsync.password文件权限不是600
      4. rsync_backup:123456密码配置文件后面注意不要有空格
      5. rsync客户端密码文件中只输入密码信息即可,不要输入虚拟认证用户名称
    4. rsync服务位置模块错误 【客户端的错误】  Unknown module 'backup'
      【错误演示过程】
       [root@nfs01 tmp]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::backup  @ERROR: Unknown module 'backup'  rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6] 【异常问题解决】
      1. /etc/rsyncd.conf配置文件模块名称书写错误
    5. rsync服务权限阻止问题 【客户端的错误】  Permission denied 【错误演示过程】   [root@nfs01 tmp]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::backup  Password:   sending incremental file list  hosts  rsync: mkstemp ".hosts.5z3AOA" (in backup) failed: Permission denied (13)   sent 196 bytes received 27 bytes 63.71 bytes/sec  total size is 349 speedup is 1.57  rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]
      【异常问题解决】
      1. 备份目录的属主和属组不正确,不是rsync
      2. 备份目录的权限不正确,不是755
    6. rsync服务备份目录异常 【客户端的错误】  chdir failed
      【错误演示过程】
       [root@nfs01 tmp]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::backup  Password:   @ERROR: chdir failed  rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6] 【异常问题解决】
      1. 备份存储目录没有建立
      2. 建立的备份存储目录和配置文件定义不一致 说明:如果没有备份存储目录
    7. rsync服务无效用户信息 【客户端的错误】  invalid uid rsync 【错误演示过程】
       [root@nfs01 tmp]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::backup  Password:   @ERROR: invalid uid rsync  rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6] 【异常问题解决】
       rsync服务对应rsync虚拟用户不存在了
    8. 客户端已经配置了密码文件,但免秘钥登录方式,依旧需要输入密码 【客户端的错误】  password file must not be other-accessible 【错误演示过程】   [root@nfs01 tmp]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::backup --password-file=/etc/rsync.password  password file must not be other-accessible  continuing without password file  Password:   sending incremental file list  sent 26 bytes received 8 bytes 5.23 bytes/sec  total size is 349 speedup is 10.26 【异常问题解决】
       rsync客户端的秘钥文件也必须是600权限
    9. rsync客户端连接慢问题 IP === 域名 反向DNS解析  【错误日志信息】  错误日志输出 2017/03/08 20:14:43 [3422] params.c:Parameter() - Ignoring badly formed line in configuration file: ignore errors 2017/03/08 20:14:43 [3422] name lookup failed for 172.16.1.31: Name or service not known 2017/03/08 20:14:43 [3422] connect from UNKNOWN (172.16.1.31) 2017/03/08 20:14:43 [3422] rsync to backup/ from rsyncbackup@unknown (172.16.1.31) 2017/03/08 20:14:43 [3422] receiving file list 2017/03/08 20:14:43 [3422] sent 76 bytes received 83 bytes total size 349 正确日志输出 2017/03/08 20:16:45 [3443] params.c:Parameter() - Ignoring badly formed line in configuration file: ignore errors 2017/03/08 20:16:45 [3443] connect from nfs02 (172.16.1.31) 2017/03/08 20:16:45 [3443] rsync to backup/ from rsyncbackup@nfs02 (172.16.1.31) 2017/03/08 20:16:45 [3443] receiving file list 2017/03/08 20:16:45 [3443] sent 76 bytes received 83 bytes total size 349  【异常问题解决】 查看日志进行分析,编写rsync服务端hosts解析文件

    10 rsync服务没有正确启动  【错误日志信息】   Connection refused (111)  【错误演示过程】   [root@oldboy-muban ~]# rsync -avz /etc/hosts rsyncbackup@172.16.1.41::backup  rsync: failed to connect to 172.16.1.41: Connection refused (111)  rsync error: error in socket IO (code 10) at clientserver.c(124) [sender=3.0.6]  【异常问题解决】  [root@oldboy-muban ~]# rsync --daemon  [root@oldboy-muban ~]# ss -lntup |grep rsync  tcp LISTEN 0 5 :::873 :::* users:(("rsync",1434,5))  tcp LISTEN 0 5 *:873 : users:(("rsync",1434,4))  [root@oldboy-muban ~]# rsync -avz /etc/hosts rsyncbackup@172.16.1.41::backup  Password:   sending incremental file list  hosts
     sent 196 bytes received 27 bytes 49.56 bytes/sec  total size is 349 speedup is 1.57

    附录一option详细说明

        -v, --verbose 详细模式输出
        -q, --quiet 精简输出模式
        -c, --checksum 打开校验开关,强制对文件传输进行校验
        -a, --archive 归档模式,表示以递归方式传输文件,并保持所有文件属性,等于-rlptgoD
        -r, --recursive 对子目录以递归模式处理
        -R, --relative 使用相对路径信息
        -b, --backup 创建备份,也就是对于目的已经存在有同样的文件名时,将老的文件重新命名为~filename。可以使用--suffix选项来指定不同的备份文件前缀。
        --backup-dir 将备份文件(如~filename)存放在在目录下。
        -suffix=SUFFIX 定义备份文件前缀
        -u, --update 仅仅进行更新,也就是跳过所有已经存在于DST,并且文件时间晚于要备份的文件。(不覆盖更新的文件)
        -l, --links 保留软链结
        -L, --copy-links 想对待常规文件一样处理软链结
        --copy-unsafe-links 仅仅拷贝指向SRC路径目录树以外的链结
        --safe-links 忽略指向SRC路径目录树以外的链结
        -H, --hard-links 保留硬链结
        -p, --perms 保持文件权限
        -o, --owner 保持文件属主信息
        -g, --group 保持文件属组信息
        -D, --devices 保持设备文件信息
        -t, --times 保持文件时间信息
        -S, --sparse 对稀疏文件进行特殊处理以节省DST的空间
        -n, --dry-run现实哪些文件将被传输
        -W, --whole-file 拷贝文件,不进行增量检测
        -x, --one-file-system 不要跨越文件系统边界
        -B, --block-size=SIZE 检验算法使用的块尺寸,默认是700字节
        -e, --rsh=COMMAND 指定使用rsh、ssh方式进行数据同步
        --rsync-path=PATH 指定远程服务器上的rsync命令所在路径信息
        -C, --cvs-exclude 使用和CVS一样的方法自动忽略文件,用来排除那些不希望传输的文件
        --existing 仅仅更新那些已经存在于DST的文件,而不备份那些新创建的文件
        --delete 删除那些DST中SRC没有的文件
        --delete-excluded 同样删除接收端那些被该选项指定排除的文件
        --delete-after 传输结束以后再删除
        --ignore-errors 及时出现IO错误也进行删除
        --max-delete=NUM 最多删除NUM个文件
        --partial 保留那些因故没有完全传输的文件,以是加快随后的再次传输
        --force 强制删除目录,即使不为空
        --numeric-ids 不将数字的用户和组ID匹配为用户名和组名
        --timeout=TIME IP超时时间,单位为秒
        -I, --ignore-times 不跳过那些有同样的时间和长度的文件
        --size-only 当决定是否要备份文件时,仅仅察看文件大小而不考虑文件时间
        --modify-window=NUM 决定文件是否时间相同时使用的时间戳窗口,默认为0
        -T --temp-dir=DIR 在DIR中创建临时文件
        --compare-dest=DIR 同样比较DIR中的文件来决定是否需要备份
        -P 等同于 --partial
        --progress 显示备份过程
        -z, --compress 对备份的文件在传输时进行压缩处理
        --exclude=PATTERN 指定排除不需要传输的文件模式
        --include=PATTERN 指定不排除而需要传输的文件模式
        --exclude-from=FILE 排除FILE中指定模式的文件
        --include-from=FILE 不排除FILE指定模式匹配的文件
        --version 打印版本信息
        --address 绑定到特定的地址
        --config=FILE 指定其他的配置文件,不使用默认的rsyncd.conf文件
        --port=PORT 指定其他的rsync服务端口
        --blocking-io 对远程shell使用阻塞IO
        -stats 给出某些文件的传输状态
        --progress 在传输时现实传输过程
        --log-format=formAT 指定日志文件格式
        --password-file=FILE 从FILE中得到密码
        --bwlimit=KBPS 限制I/O带宽,KBytes per second
        -h, --help 显示帮助信息

    附录二rsyncd.conf文件的详细配置文件

    pid file = /var/run/rsyncd.pid #进程 pid 文件所在位置
    port = 873 #指定监听端口,默认是873,可以自己指定
    address = 192.168.1.171 #服务器监听的IP地址,可省略
     
    uid = root #守护进程所属的uid,默认是nobody,可能会碰到文件或目录权限问题,此处偷懒用root
    gid = root#守护进程的gid
     
    #chroot,即改变程序执行时所参考的根目录位置,在传输文件之前,服务器守护程序在将chroot 到文件系统中的目录中
    #这样做的好处是可能保护系统被安装漏洞侵袭的可能。缺点是需要超级用户权限。另外对符号链接文件,将会排除在外
    #也就是说,你在 rsync服务器上,如果有符号链接,你在备份服务器上运行客户端的同步数据时,只会把符号链接名同步下来,并不会同步符号链接的内容
    use chroot = yes
     
    read only = no #只读选择,只让客户端从服务器上读取文件
    write only = yes #只写选择,只让客户端到服务器上写入
     
    #允许访问的IP,可以指定单个IP,也可以指定整个网段,能提高安全性。格式是 ip 与 ip 之间、ip 和网段之间、网段和网段之间要用空格隔开;
    hosts allow = 192.168.1.0/255.255.255.0 10.0.1.0/255.255.255.0 
     
    max connections = 5 #客户端最多连接数
     
    #当用户登录时会看到这个信息。比如显示当前时间、公告等
    motd file = /etc/rsyncd/rsyncd.motd
     
    log file = /var/log/rsync.log #rsync 服务器的日志;
    transfer logging = yes #记录传输文件的日志
    log format = %t %a %m %f %b #日志格式
    syslog facility = local3 #日志级别
     
    #通过该选项可以覆盖客户指定的IP超时时间。可以确保rsync服务器不会永远等待一个崩溃的客户端。超时单位为秒钟,0表示没有超时定义,这也是默认值。对于匿名rsync服务器来说,一个理想的数字是600。
    timeout = 300 
     
    #模块定义
    #主要是定义服务器哪个目录要被同步。
    #每个模块都要以[name]形式。这个名字就是在 rsync 客户端看到的名字。
    #但是服务器真正同步的数据是通过 path 指定的。可以依次创建多个模块。
    #每个模块要指定认证用户、密码文件,但排除并不是必须的。
    [ logs ] #模块名,以下配置都属于此模块
    path = /var/log #文件目录所在位置
    list = no #当查看服务器上提供了哪些目录时是否列出来,no比较安全
    ignore errors #忽略I/O错误
     
    #指定由空格或逗号分隔的用户名列表,只有这些用户才允许连接该模块。这里的用户和系统用户没有任何关系,是 rsyncd.secrets 中的用户名!
    #如果"auth users"被设置,那么客户端发出对该模块的连接请求以后会被rsync请求challenged进行验证身份。
    #这里使用的 challenge/response 认证协议。
    #用户的名和密码以明文方式存放在"secrets file"选项指定的文件中。默认情况下无需密码就可以连接模块(也就是匿名方式)。
    auth users = zhangzk
    secrets file = /etc/rsyncd/rsyncd.secrets #密码文件
     
    exclude = error_log httpd.pid #忽略的文件或目录
    comment this is my log #本模块注释,可选

    I have a dream so I study hard!!!
  • 相关阅读:
    C#如何从普通C++动态库导入一个类?
    MFC的子类化技术
    [转贴] 不要以为使用了模式就是好设计
    VC编程经验汇总(三)
    钩子技术介绍及函数使用
    关于VC中的时间函数讨论
    my read_girl
    Linux + SVN / CVS / ClearCase
    OS + Linux Edit emacs /vi vim gvim /SciTE /gedit /kedit /UltraEdit /nedit /sedf
    java Regular Expression / regexp / zhengzebiaodashi
  • 原文地址:https://www.cnblogs.com/yaokaka/p/11620716.html
Copyright © 2011-2022 走看看