I was wondering if others might find it useful to have a parameter in the rsync daemon config that would allow running a command on the server at session start or at successful rsync completion. For instance, this would allow a webpage to be automatically maintained (by a script called by this method) with the timestamps of the last successful rsync completion (no errors, all files transferred), which would be very nice for keeping track of the state of mirrors. I looked in the patches directory, and see there is already a pre-post-exec.diff patch to allow for running scripts before and after the chroot, but I'm more interested in running after successful rsync completion than after the chroot. The already present patch also doesn't allow for some method of passing other useful information like the username of an authenticated user, or the ipaddress of the rsync client, either of which might be useful in tracking which mirrors were up to date. Other info like the module name or even the number/size of files transferred would also be useful. This would also be very nice for doing things like queuing a backup job for the module that was rsynced in the case of dirs pushed to the server for the purposes of backups. Maybe also a way to bypass the script if no files were transferred, but the rsync was otherwise error-free. Comments appreciated. Evan
On Tue, 19 Jul 2005 12:10:18 -0700, Evan Harris <eharris@puremagic.com> wrote:> > I was wondering if others might find it useful to have a parameter in the > rsync daemon config that would allow running a command on the server at > session start or at successful rsync completion. > > For instance, this would allow a webpage to be automatically maintained > (by > a script called by this method) with the timestamps of the last > successful > rsync completion (no errors, all files transferred), which would be very > nice for keeping track of the state of mirrors.Couldn't you just do this on the client side? rsync... ssh commands to run after rsync...
On Tue, Jul 19, 2005 at 02:10:18PM -0500, Evan Harris wrote:> I looked in the patches directory, and see there is already a > pre-post-exec.diff patch to allow for running scripts before and after > the chroot, but I'm more interested in running after successful rsync > completion than after the chroot.That patch does run a command after the completion of the rsync (whether it was successful or not). I've just upgraded it to add more environment variables (such as module name, module path, host name, host IP, user name, exit status). I also changed where the post-rsync exec happens so that both the pre- and post-xfer are both now run by the user that runs the daemon (not the module's user) and without any chroot constraints (the old patch was simpler, and it made the post-xfer command run in a more restricted setting than the pre-xfer command). You can see the latest patch here: http://rsync.samba.org/ftp/unpacked/rsync/patches/pre-post-exec.diff> Maybe also a way to bypass the script if no files were transferred, > but the rsync was otherwise error-free.The current patch doesn't include any info on transfer direction nor any transfer stats (which might not be easy to do). ..wayne..
Seemingly Similar Threads
- Question and feature requests for processor bound systems
- [Bug 1529] 32bit rollover problem rsyncing files greater than 4GB in size
- post-xfer exec -- more juice!
- Regarding an "earlier" variant of `pre-xfer exec` [feature request and proposed patch]
- Zone file not written to slave DNS server