I am using sshpass in a script which executes rsync and backup a file from remote server, I added that script to cron which runs every minute. Now I am concerned about the connections, does the connection remains opened? how shall I close the connection when rsync is done?

Is this handled by sshpass internally, please suggest some alternative if connections are left open.


The sshpass is only wrapper to provide password to the rsync/ssh command inside. Once the rsync ends, the connection is automatically closed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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