The problem it solves, is when you rsync files to a target server, you want to run chown afterwards to set the user and group owners. There seems to b

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-04-24 01:00:02

The problem it solves, is when you rsync files to a target server, you want to run chown afterwards to set the user and group owners.

There seems to be options for setting ownership within rsync but macos has an ancient version of rsync and even current versions of rsync don't seem to work in any way that makes sense to me.

Fuck knows why rsync can't do this and fuck knows why Macos is not using a new version of rsync and I'm not spending any more time trying to work it out - instead I wrote this wrapper.

./rsyncchown --chown=root:appusergroup:/opt/authserver -e "ssh -p 22 " --exclude=.svn --exclude=.cvs --exclude=.idea --exclude=.DS_Store --exclude=.git --exclude=.hg --exclude=.hprof --exclude=.pyc auth_server.py ubuntu@mysshhostname:/opt/authserver///auth_server.py

The arguments are all passed intact to rsync EXCEPT for the --chown=root:appusergroup:/opt/authserver argument which is NOT passed to rsync.

Leave a Comment