Created
June 7, 2019 10:53
-
-
Save christianascone/115d131c5e1cf6d7b19a67b4aa50f16d to your computer and use it in GitHub Desktop.
Automatic rsync between local and remote machine using a no-password ssh key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "###########################" | |
| echo $(date -u) "Starting rsync data" | |
| eval `ssh-agent -s` | |
| ssh-add ~/.ssh/key_name | |
| rsync -vrahe ssh ~/www/local/data/upload [email protected]:/home/remote/dir | |
| echo $(date -u) "Ended rsync data" | |
| echo "###########################" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment