i am trying to get a list of files from secure server to compare them (using diff) to the ones i modified on local version (unfortunately the company i work in is not using subversion nor git yet)
i get list of files easily with:
find . -mtime -20 | grep "\.php\|\.js\|\.css" > changedfiles.log
what i need is a script which would loop over this list and secure copy each of them (scp or rsync) to a local directory, preserving relative path name. i tried:
for line in `cat changedfiles.log`
do
DIRPATH=`dirname "$line"`
`mkdir -p myfiles/$DIRPATH`
scp user@host:/remotepath/$line myfiles/$line
done
but scp keeps asking me for the password (i dont want to setup key-based authentication to scp without password)
i am not allowed to ssh on remote server so i cannot just zip the list and download them in one command
is it possible to do something to input password only once?