I would like to automate a script that regularly runs rsync, and rsync prompts for my ssh key password each time I run it.
I don't mind typing the password once at the beginning of the script. I can't be prompted each time it runs an rsync command in a loop.
Is there a clean, safe way to prompt for the password once and continue using it?
My assumed solution would be to prompt for the password somehow (not sure how to do that off the top of my head) and store it in an environment variable, then use expect to make use of it. But I feel like there might be an easier approach that I'm not aware of.