How to securely transfer files to a remote server and automate it with a bash script