zoukankan      html  css  js  c++  java
  • [linux]在使用rsync时需要注意的小细节

    很简单:前一个目录末尾是目录的话,最后是否带/是有区别的。

    具体看测试:

    # usr @ the-pc in ~/cptest02 [2:28:02] 
    $ ll 
    总用量 0
    
    # usr @ the-pc in ~/cptest02 [2:28:03] 
    $ ll ../cptest01/ 
    总用量 4
    -rw-rw-r-- 1 usr usr    0 10月 11 02:23 11111file
    drwxrwxr-x 2 usr usr 4096 10月 11 02:23 pppp
    
    # usr @ the-pc in ~/cptest02 [2:28:14] 
    $ rsync -av ../cptest01/ ./
    sending incremental file list
    ./
    11111file
    pppp/
    pppp/adadasd.file
    
    sent 187 bytes  received 57 bytes  488.00 bytes/sec
    total size is 0  speedup is 0.00
    
    # usr @ the-pc in ~/cptest02 [2:28:33] 
    $ ll 
    总用量 4
    -rw-rw-r-- 1 usr usr    0 10月 11 02:23 11111file
    drwxrwxr-x 2 usr usr 4096 10月 11 02:23 pppp
    
    # usr @ the-pc in ~/cptest02 [2:28:46] 
    $ rsync -av ../cptest01 ./ 
    sending incremental file list
    cptest01/
    cptest01/11111file
    cptest01/pppp/
    cptest01/pppp/adadasd.file
    
    sent 201 bytes  received 58 bytes  518.00 bytes/sec
    total size is 0  speedup is 0.00
    
    # usr @ the-pc in ~/cptest02 [2:28:53] 
    $ ll 
    总用量 8
    -rw-rw-r-- 1 usr usr    0 10月 11 02:23 11111file
    drwxrwxr-x 3 usr usr 4096 10月 11 02:23 cptest01
    drwxrwxr-x 2 usr usr 4096 10月 11 02:23 pppp
    
    # usr @ the-pc in ~/cptest02 [2:28:56] 
    $
    

    (shell是zsh,主题是ys。)

  • 相关阅读:
    python 代码片段17
    python 代码片段15
    python 代码片段14
    python 代码片段13
    python 代码片段12
    RBAC模型
    2、服务注册与发现-电影服务
    1、通过eureka创建注册中心
    prop与attr
    位运算,效率高
  • 原文地址:https://www.cnblogs.com/senwren/p/rsync_attention_0.html
Copyright © 2011-2022 走看看