I currently use a bash script in the following format to update local data with remote one:
usr=$1
scp -P 4444 -r $usr@some.other.machine.at:/some/folder/*Tools /home/localUser/someFolder/
scp -P 4444 -r $usr@some.other.machine.at:/some/folder/*.project /home/localUser/someFolder/
i.e., I want to copy each folder (its content and subfolders) that ends with Tools and to copy each file that ends with .project from /some/folder/
(okay, I would not need -r here) at the remote machine into my local folder /home/localUser/someFolder/
.
(Not sure if this is important, I run this script with bash myScript.sh
)
Currently, I have to enter the remote user's password two times, once per scp
command. Is there a way so that the password has to be entered only one time?
sshpass
to automate entering the password, but I don't see the point of doing that over setting up keys. – muru Feb 22 '16 at 09:23