Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I run rsync from a script and that's working fine but of course this will only work if the machine has the necessary SSH keys installed. Sometimes the script is run on other machines and the process hangs because it is waiting for a password.

I'd like to tell rsync that whenever it requires interactive authentication it should just fail and exit instead of waiting. However I was unable to find such an option in the man page.

So I'm not looking for a way to tell rsync the right password but a way to prevent any interaction if that means rsync termination.

Alternatively is there a way to know (from another process) if rsync is waiting for a password/abort the password prompt?

share|improve this question
1  
ssh is doing the authentication, so check if there's an ssh option to do what you need. –  dr-jan Apr 29 '13 at 12:02

1 Answer 1

up vote 0 down vote accepted

Thanks to dr-jan I was able to figure it out myself:

rsync -e "ssh -o 'BatchMode yes'" [the usual rsync parameters]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.