diff --git a/sync.sh b/sync.sh deleted file mode 100755 index 8970ae0..0000000 --- a/sync.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -readonly PROJECT=volcano - -readonly USAGE=" -USAGE: -$(basename "$0") [UPLOAD or DOWNLOAD]" - -function help_message() { - echo "$USAGE" -} - -PARAMETERS="UPLOAD DOWNLOAD upload download" - -# check if there are all the parameters -if [ "$#" -ne 1 ]; then - help_message - exit 0 -fi - -# check if the systems parameter is valid -if ! echo "$PARAMETERS" | grep -w "$1" >/dev/null; then - help_message - exit 0 -fi - -# UPLOAD -if [ "$1" = upload ] || [ "$1" = UPLOAD ]; then - printf "\n%s\n" "uploading $PROJECT" - rsync -azmPu --delete -e 'ssh -p 4545' . sergio@sustancia.synology.me:/home/sergio/backup/code/$PROJECT/ - rsync -azmPu -e 'ssh -p 4545' . sergio@sustancia.synology.me:/home/sergio/backup/code/$PROJECT.all/ -fi - -if [ "$1" = download ] || [ "$1" = DOWNLOAD ]; then - printf "%s\n" "downloading $PROJECT" - rsync -azmP --delete -e 'ssh -p 4545' sergio@sustancia.synology.me:/home/sergio/backup/code/$PROJECT/* . -fi \ No newline at end of file