I have a remote server and a local server. I am trying to automatically transfer a nightly backup on the remote server to my local one. SSH keys are setup, so no password is required.
Using the following command, it works manually:
scp -r -P {REMOTEPORT} user@serveripaddress:/home/remoteuser/directory /home/localuser/directory
I would like to set a cronjob so the previous action runs, but I am new to writing actual scripts. Is there a simple script that would make this happen?