เวอร์ชั่น 3.1.0ของ rsync ได้นำเสนอ--usermapและ--groupmapกล่าวถึงโดย Thomas แต่ยังเป็นตัวเลือกความสะดวกสบาย--chownซึ่งทำงานได้ดีกับสถานการณ์ของคุณ
--chown=USER:GROUP
This option forces all files to be owned by USER with group GROUP.
This is a simpler interface than using --usermap and --groupmap directly,
but it is implemented using those options internally, so you cannot mix them.
If either the USER or GROUP is empty, no mapping for the omitted user/group will
occur. If GROUP is empty, the trailing colon may be omitted, but if USER is
empty, a leading colon must be supplied.
If you specify "--chown=foo:bar, this is exactly the same as specifying
"--usermap=*:foo --groupmap=*:bar", only easier.
นอกจากนี้ยังจำเป็นต้องใช้-oและ-gตัวเลือก หากไม่รวมพวกเขาจะไม่สามารถอัปเดตแอตทริบิวต์ที่เกี่ยวข้องได้ แต่จะไม่มีข้อผิดพลาดเกิดขึ้น
rsync -og --chown=cmsseren:cmsseren [src] [dest]
สิ่งนี้ถูกกล่าวถึงทางอ้อมในmanpageซึ่งระบุว่า--chownตัวเลือก "ถูกนำไปใช้งานโดยใช้--usermapและ--groupmapภายใน" และ:
เพื่อให้--usermapตัวเลือกมีผลกระทบต้องใช้ตัวเลือก-o( --owner) (หรือโดยนัย) และผู้รับจะต้องใช้งานเป็นผู้ใช้ขั้นสูง (ดูเพิ่มเติมที่--fake-superตัวเลือก)
เพื่อให้--groupmapตัวเลือกมีผลกระทบต้องใช้ตัวเลือก-g( --groups) (หรือโดยนัย) และผู้รับจะต้องมีสิทธิ์ในการตั้งค่ากลุ่มนั้น