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。)

  • 相关阅读:
    浅析BIO、NIO、AIO
    equals()和hashCode()区别
    mysql分区
    java反射
    设计模式
    两个线程一个生产者个一个消费者
    Redis事务
    常用面试题
    springboot整合redis(注解形式)
    ElasticSearch6更新与重大变化
  • 原文地址:https://www.cnblogs.com/senwren/p/rsync_attention_0.html
Copyright © 2011-2022 走看看