SCP bash script
A SCP bash script I wrote for SCP transfer via SSH. Any explanations needed please post a comment.
Have been really busy lately so haven’t done many updates so am sharing a script I wrote, although the script can be useful for automating scp its aimed as howto use scp example as well as learning howto use a Linux (Bash) shell.
echo “Enter Filename if in the same directory (relative path) if not use the full path to the file (absolute path) i.e /bin/bash instead of bash”
echo “Enter destination server”
echo “Enter destination directory, must include / i.e /root not root”
echo “SSH Port?”
scp -P $PORT $SOURCE $USER@$DESTINATION:$DESTINATIONDIR
In English or direct syntax to enter would be.
scp -P 22 file email@example.com:/root