I use rsync to update my static website. I currently cd to the local website directory, and run the rsync command, and then enter the password in the next line. I’ve saved my rsync call into a text snippet (such that _rs just expands to my call). Is there way to use something like a -p flag at the end and include the password too?
My call looks like this:
rsync -avzh -e ssh * foo@foo.org:"/home/foo/public_html/"
One of option is use public/private key pair, see How to auto rsync with ssh passwordless
Or you can try use Expect