Igor Hjelmstrom Vinhas Ribeiro
2005-Sep-14 19:22 UTC
How to do server-side logging with rsync running through a SSH tunnel?
Hello! I am using rsync to synchronize files between a master server and multiple clients that share a SSH account. I am struggling right now to make the server log what files were transferred, and when the synchronization happens. My setup follows. The clients log to an ssh account configured to run a script as the login shell: (in ~/.ssh/authorized keys) command="/home/igor/rsync_shell" The script checks if the command is valid (and also if it points inside somewhere allowed) and at its end issues: rsync --config=/home/igor/rsyncd.conf --daemon --server --sender -vr . ./somefolder/somewhere Unfortunately, from what I saw in an old message (http://www.mail-archive.com/rsync@lists.samba.org/msg04728.html) in the archive, "rsync --daemon and ssh do not currently work together at all". The script works, but the config file seems to be ignored: there is a log file definition inside it and no logging takes place when I run the rsync command in the clients (the process works and the files are properly synchronized, though). What I am missing? Is there any other way (besides a config file) to make the server log transfers to a file? If the answer is yes, please tell me... Thanks for you patience, Igor.
Wayne Davison
2005-Sep-15 08:24 UTC
How to do server-side logging with rsync running through a SSH tunnel?
On Wed, Sep 14, 2005 at 04:22:01PM -0300, Igor Hjelmstrom Vinhas Ribeiro wrote:> rsync --config=/home/igor/rsyncd.conf --daemon --server --sender -vr . > ./somefolder/somewhereA modern rsync would reject that command-line as invalid (since --sender and -r aren't daemon options, and paths aren't sent to a daemon on the command-line -- such client-to-server items are sent to the daemon via the internal protocol). I gave a basic answer to this question of server-side logging using a daemon-over-ssh setup back on August 24th (it's pretty terse, though): http://lists.samba.org/archive/rsync/2005-August/013359.html The important bit is to make sure that the client command is using daemon-style host syntax (it sounds like you're not if your rsync_shell script is checking path names -- there's no need to check paths with daemon mode since the modules set their own path, nor is it possible without parsing the start of the incoming data). Also, make sure you're using a modern enough rsync that supports daemon-mode over ssh (it was added in 2.5.6) and make sure that you're sending rsync a valid daemon command-line. ..wayne..