Tomasz Chmielewski
2007-Jan-10 11:41 UTC
passing rsyncd password in a script (no ssh) - how?
I want to transfer files from a Windows server running rsyncd to a local Linux machine. It has no SSH, so I can't use keys. I need credentials to access files on the rsyncd server, so I thought using "expect" to pass a password in a script is the obvious choice: /usr/bin/expect <<! set timeout -1 spawn rsync --partial -a rsync://username@server/share/dir /local/copy expect "Password: " send "secret_password\n" expect ! However, this has a drawback that I loose the exit code produced by rsync (I'm no expect guru, so maybe perhaps there is a workaround to that). What is the recommended way to copy files from a (password-protected) rsyncd server in a script? -- Tomasz Chmielewski
Tomasz Chmielewski
2007-Jan-10 11:48 UTC
passing rsyncd password in a script (no ssh) - how?
Tomasz Chmielewski wrote:> I want to transfer files from a Windows server running rsyncd to a local > Linux machine. It has no SSH, so I can't use keys.(...)> What is the recommended way to copy files from a (password-protected) > rsyncd server in a script?Looks like I should use: export RSYNC_PASSWORD=secret_pass before starting rsyncd. And to forget about "expect" command :) -- Tomasz Chmielewski http://wpkg.org