From 0e79399120c0dbba18df4cd607555b145a615c3f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 8 Nov 2021 22:07:31 +0100 Subject: [PATCH] sync --- sync.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sync.sh b/sync.sh index 4ae5a97..3a30d6c 100755 --- a/sync.sh +++ b/sync.sh @@ -1,20 +1,20 @@ -#! /bin/bash -FILE="$(realpath "${BASH_SOURCE[0]}")" -DIRECTORY="$(dirname "${FILE}")" +#! /usr/bin/env bash +BASH_FILE="$(realpath "${BASH_SOURCE[0]}")" +BASH_ROOT="$(dirname "${BASH_FILE}")" -OUT='output' +OUTPUT='output' function rs { echo; \ echo "→ ${2} @ ${3} : ${1}"; \ ssh -o 'LogLevel Error' -p ${1} "${2}@${3}" \ -df -h . +df --human-readable . } function rs { echo "→ ${2} @ ${3} : ${1}" rsync --verbose --progress \ --rsh "ssh -o 'LogLevel Error' -p ${1}" \ --archive --checksum --delete-before \ -"${DIRECTORY}/${OUT}/" \ +"${BASH_ROOT}/${OUTPUT}/" \ "${2}@${3}:${4}/" \ > /dev/null }