page counter next up previous contents
Next: 用法三-檔案新舊 Up: Rsync 檔案備援 Previous: 基本用法一   Contents   DYWANG_HOME

基本用法二

  1. 在 /home/deyu1/cron.daily/logrotate 檔案最後加入一行 'rsync test'。
    [root@kvm5 ~]# echo 'rsync test' >> /home/deyu1/cron.daily/logrotate
    
  2. 比較來源端與目的端的 logrotate,檔案內容不一樣。
    [root@kvm5 ~]# diff -uN /etc/cron.daily/logrotate /home/deyu1/cron.daily/logrotate
    --- /etc/cron.daily/logrotate	2013-07-31 19:46:23.000000000 +0800
    +++ /home/deyu1/cron.daily/logrotate	2019-10-11 16:07:37.000000000 +0800
    @@ -6,3 +6,4 @@
         /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
     fi
     exit 0
    +rsync test
    
  3. 執行 rsync,只同步不一樣的檔案 logrotate。
    [root@kvm5 ~]# rsync -avh /etc/cron.daily /home/deyu1/sending incremental file list
    cron.daily/logrotate
    
    sent 344 bytes  received 32 bytes  752.00 bytes/sec
    total size is 1.13K  speedup is 3.01
    



De-Yu Wang 2020-05-14