ฉันเพิ่มไฟล์ใหม่ไปยัง / dir / a และเรียกใช้คำสั่งเดียวกันอีกครั้งมันรู้ว่ามันทำอะไรและคัดลอกไฟล์ใหม่เท่านั้น
ไม่ไม่รู้ว่ามันทำอะไรในการวิ่งครั้งก่อน มันเปรียบเทียบข้อมูลในด้านการรับกับข้อมูลที่จะส่ง ด้วยข้อมูลที่มีขนาดเล็กมากสิ่งนี้จะไม่ปรากฏชัดเจน แต่เมื่อคุณมีไดเรกทอรีมากพอเวลาที่ใช้ในการเปรียบเทียบก่อนที่จะเริ่มการคัดลอกจริง ๆ จะรู้สึกได้ง่าย
การตรวจสอบเริ่มต้นใช้สำหรับเวลาและขนาดในการแก้ไขไฟล์ จากman rsync:
-c, --checksum
      This changes the way rsync checks if the files have been changed
      and  are in need of a transfer.  Without this option, rsync uses
      a "quick check" that (by default) checks if each file’s size and
      time of last modification match between the sender and receiver.
      This option changes this to compare a 128-bit checksum for  each
      file  that  has a matching size.  Generating the checksums means
      that both sides will expend a lot of disk I/O  reading  all  the
      data  in  the  files  in  the transfer (and this is prior to any
      reading that will be done to transfer changed  files),  so  this
      can slow things down significantly.
และ:
-u, --update
      This  forces  rsync  to  skip  any  files  which  exist  on  the
      destination  and  have  a  modified  time that is newer than the
      source  file.   (If  an  existing   destination   file   has   a
      modification time equal to the source file’s, it will be updated
      if the sizes are different.)
โปรดทราบว่าสิ่งเหล่านี้ไม่ได้บอกเป็นนัยโดยตัวเลือกที่คุณใช้ -aคือ:
-a, --archive               archive mode; same as -rlptgoD (no -H)
-r, --recursive             recurse into directories
-l, --links                 copy symlinks as symlinks
-p, --perms                 preserve permissions
-o, --owner                 preserve owner (super-user only)
-g, --group                 preserve group
    --devices               preserve device files (super-user only)
    --specials              preserve special files
-D                          same as --devices --specials
-t, --times                 preserve times
               
              
-iธงเป็นประโยชน์มาก สำหรับทุกไฟล์จะให้สตริงการจับคู่ที่สามารถถอดรหัสเพื่อดูว่าทำไมมันจึงจับคู่ (ตั้งค่าสถานะสำหรับเวลา mod, ตั้งค่าขนาด ฯลฯ )