วิธีรับไฟล์ที่อัพเดตใหม่จากบันทึก rsync

ฉันมักจะใช้คำสั่ง rsync สำหรับการสำรองข้อมูลด้านล่าง

$ rsync -auvvz source_dir destination_dir

หากต้องการเพิ่มความฟุ่มเฟือย ฉันใช้ตัวเลือก v แต่ในกรณีนี้ มีบันทึกมากเกินไปที่จะรับบันทึกไฟล์ที่อัปเดตใหม่ที่คอนโซล

ex)

hgoe/foo/foo/test1 is uptodate
hgoe/foo/foo/test2 <- I want to pick up logs like this.
hgoe/foo/foo/test3 is uptodate

จะรับบันทึกได้อย่างไร?


person Akira Noguchi    schedule 09.12.2011    source แหล่งที่มา
comment
ดังนั้น? มันไม่ได้แก้ปัญหาของคุณใช่ไหม?   -  person Joao Figueiredo    schedule 14.12.2011


คำตอบ (1)


แฮ็คน่าเกลียดแต่ใช้งานได้

rsync -auvvz source_dir destination_dir| grep -vE '(sending incremental file list|delta-transmission disabled| is uptodate|total: matches=| bytes/sec| speedup is |^$)'

grep -v สอดคล้องกับตัวเลือก --invert-match

ในขณะที่ -E ไปที่ --extensed-regexp หนึ่ง

^$ ลบบรรทัดว่าง

รูปแบบอื่นๆ ทั้งหมดรวมอยู่ในเอาต์พุตเริ่มต้นสำหรับ rsync -auvvz

person Joao Figueiredo    schedule 13.12.2011