I am able to perform the following line rsync -rsh="/usr/bin/ssh" filename host:/dir/filename But I am not able to perform this rsync -rsh="/usr/bin/ssh" filename host:module_name where rsyncd.conf contains the following pid file = /var/run/rsyncd.pid log file = /var/log/rsyncd.log read only = false [module_name] path = /home/test comment = New Test The client thinks that everything is going ok but the file never shows up in the target directory. I think that this is because it is using ssh and never reads the rsyncd.conf file. I've shut down the rsync -daemon process and proved this. Now the question. How do I get rsync to transfer the files using the rules called out in the rsyncd.conf file while using ssh? Jacque Mergens Sr Systems Engineer Emageon 1200 Corporate Dr Birmingham, AL 35242 205.980.7543 (o) 205.410.8326 (c)
On Tue 24 Feb 2004, Jacque Mergens wrote:> > rsync -rsh="/usr/bin/ssh" filename host:/dir/filename > > > > But I am not able to perform this > > > > rsync -rsh="/usr/bin/ssh" filename host:module_nameNo, because mdoules are only handled by the rsync daemon, which is contacted via its own tcp port. Additionally modules are indicated by a double colon "::module_name". What you're telling rsync above is to transfer to the directory module_name in your home directory on "host".> The client thinks that everything is going ok but the file never shows up in > the target directory.Check the home dir...> How do I get rsync to transfer the files using the rules called out in the > rsyncd.conf file while using ssh?You'd have to forward the rsync port over an ssh connection: ssh -L8730:127.0.0.1:873 host Then, (separately) use rsync like so: rsync --port=8730 filename localhost::module_name and after the transfer stop the ssh session. but that's a rather roundabout method... Paul Slootman
On Wed, 25 Feb 2004, Paul Slootman wrote:> > How do I get rsync to transfer the files using the rules called out in the > > rsyncd.conf file while using ssh? > > You'd have to forward the rsync port over an ssh connection: > > ssh -L8730:127.0.0.1:873 host > > Then, (separately) use rsync like so: > > rsync --port=8730 filename localhost::module_name > > and after the transfer stop the ssh session. > > but that's a rather roundabout method... >There's an easier method that's been covered a few times on this list, using SSH keys and forced commands in the authorized_keys file. Make a keypair, and on the side you are backing up from add something like this before the key entry: command="/path/to/rsync --server --daemon --config /path/to/rsyncd.conf",from="x.x.x.x" Then wherever you are backing up to, you can do something like rsync -e "ssh -2 -i key_file_here" user@host::module/ /destination/directory/ There's more sample info and some pitfalls you can avoid elsewhere on this list, check the searchable archives at http://marc.theaimsgroup.com/?l=rsync&r=1&w=2 Tom