rsync : คัดลอกไฟล์หากไม่มีไฟล์ในเครื่อง อย่าตรวจสอบขนาดไฟล์ เวลา ผลรวมตรวจสอบ ฯลฯ

ฉันใช้ rsync เพื่อสำรองรูปภาพนับล้านจากเซิร์ฟเวอร์ linux ไปยังคอมพิวเตอร์ของฉัน (windows 7 โดยใช้ Cygwin)

คำสั่งที่ฉันใช้ตอนนี้คือ:

rsync -rt --quiet --rsh='ssh -p2200' [email protected]:/home/XXX/public_html/XXX /cygdrive/images

เมื่อใดก็ตามที่กระบวนการถูกขัดจังหวะ และฉันเริ่มต้นใหม่อีกครั้ง จะใช้เวลานานในการเริ่มกระบวนการคัดลอก ฉันคิดว่ามันกำลังตรวจสอบแต่ละไฟล์หากมีการอัพเดตใด ๆ

รูปภาพบนเซิร์ฟเวอร์ของฉันจะไม่เปลี่ยนแปลงเมื่อสร้างขึ้นแล้ว

มีวิธีที่เร็วกว่าในการรันคำสั่งเพื่อให้สามารถคัดลอกไฟล์ได้หากไม่มีไฟล์ในเครื่องโดยไม่ตรวจสอบขนาดไฟล์ เวลา เช็คซัม ฯลฯ ...

กรุณาแนะนำ

ขอบคุณ


person Arnold    schedule 09.09.2013    source แหล่งที่มา


คำตอบ (1)


คุณได้ลองใช้แฟล็กนี้แล้ว - อาจช่วยได้ แต่อาจต้องใช้เวลาพอสมควรในการโอนต่อ:

       --ignore-existing
          This tells rsync to skip updating files that already exist on the destination  (this  does  not  ignore
          existing directories, or nothing would get done).  See also --existing.

          This  option  is  a  transfer  rule,  not  an exclude, so it doesn't affect the data that goes into the
          file-lists, and thus it doesn't affect deletions.  It just limits the files that the receiver  requests
          to be transferred.

          This  option  can be useful for those doing backups using the --link-dest option when they need to con-
          tinue a backup run that got interrupted.  Since a --link-dest run is copied into a new directory  hier-
          archy  (when  it  is used properly), using --ignore existing will ensure that the already-handled files
          don't get tweaked (which avoids a change in permissions on the hard-linked files).  This does mean that
          this option is only looking at the existing files in the destination hierarchy itself.
person mnagel    schedule 09.09.2013