I'm looking to see of it is practical to have an rsync server run a script after a transfer finishes. I am moving files (python source) from windows (common point of development) to a few linux machines. big problem being owner/group/perms are always wrong and python's module install process is fragile with respect to OGP. Therefore, I want to run a script after transferring a set of files so I can correct all of the ownership/group/permissions from the Windows defaults to what I need. ---eric (speech recognition in use, it makes mistakes, I can't keep up with them all)
On Sun, 2007-11-18 at 00:40 -0500, Eric S. Johansson wrote:> I'm looking to see of it is practical to have an rsync server run a script after > a transfer finishes.If you mean the server process invoked over remote shell, you could do something like this: rsync --rsync-path='rsync-and-fix-ogp' ... and write a script called rsync-and-fix-ogp on the destination: #!/bin/bash rsync "$@" && chmod/chown... If you mean an rsync daemon, you want the "post-xfer exec" configuration parameter; see the rsyncd.conf(5) man page.> I am moving files (python source) from windows (common > point of development) to a few linux machines. big problem being > owner/group/perms are always wrong and python's module install process is > fragile with respect to OGP. Therefore, I want to run a script after > transferring a set of files so I can correct all of the > ownership/group/permissions from the Windows defaults to what I need.You may be able to get the attributes right with some options to rsync rather than a separate script. Don't pass -o, -g, -p, or -a (which implies -ogp), and then: use the --chmod option or the daemon's "incoming chmod" parameter to fix the permissions, and run the receiver as the desired user and group or set the daemon's "uid" and "gid". Matt
Eric S. Johansson [Sun, Nov 18, 2007 at 12:40:31AM -0500]:> [correcting permissions]I suggest you to use ACLs on Linux, so permissions are always correct. Especially default ACLs are pretty well supported by Linux, so you can do things like setfacl -m d:g:yourgroup:rwx -R . and to specify the ACL-mask setfacl -m d:m:rwx -R . And to set ACLs on already created files / directoryies: setfacl -m g:yourgroup:rwx -R . setfacl -m m:rwx -R . Makes like much easier and does not need any manual (or automatic manual) action. Sincerly Nico P.S.: You could otherwise also synchronise Unix-accounts with Windos-Accounts, though this is much more work. -- Think about Free and Open Source Software (FOSS). http://nico.schottelius.org/documentations/foss/the-term-foss/ PGP: BFE4 C736 ABE5 406F 8F42 F7CF B8BE F92A 9885 188C -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.samba.org/archive/rsync/attachments/20071119/b9fc3bb5/attachment.bin