Here is another script I created for automating scp downloads. While this script uses expect to securely transfer the password to scp, you have to take precautions to safeguard the script itself as it contains the password. I wouldn’t use this script across the internet, but for LAN transfers using scp it works.
Prior to use, modifications will need to be made and include:
- Change the user value
- Change the server value
- Change the remote dir
- Change the local directory
- Change the password value
After save the file and execute the script. All output will be shown in the command window. If you receive errors they will be displayed in the command window.
You can download the script here.