I need to write a script that backs up databases on my old server and moves them to my new server. I have about 150 to so need this to be automated. I have found this:
$ mysqldump -u username -p'password' db-name | ssh user@remote.box.com mysql -u username -p'password' db-name
Which will allow me to do this, however, it requires me to specify a password every time I run it. How can I make the ssh command take a password parameter? I tried ssh --help but couldn't see anything.
If this command cannot accept a password, can I do this another way?