Created
February 5, 2018 16:28
-
-
Save rsnemmen/747a6f7d7d52738d91a47faad730062f to your computer and use it in GitHub Desktop.
Syncs the content of the current directory with a remote server using rsync via SSH
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/sh | |
| # | |
| # Syncs the content of the current directory with a remote server using rsync | |
| # via SSH. | |
| # | |
| # Usage: csync.sh <user@remoteserver> <remote path where directory will be synced> | |
| # | |
| # Example: csync.sh nemmen@alphacrucis pluto | |
| # check if there were command-line arguments | |
| if [ $# -eq 0 ]; then | |
| echo "Usage: " | |
| echo " csync.sh <user@remoteserver> <remote path where directory will be synced> " | |
| exit 1 | |
| fi | |
| rsync -va -e ssh --progress --delete . $1:$2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment