sync
This commit is contained in:
parent
953ec0fd7a
commit
0e79399120
1 changed files with 6 additions and 6 deletions
12
sync.sh
12
sync.sh
|
@ -1,20 +1,20 @@
|
||||||
#! /bin/bash
|
#! /usr/bin/env bash
|
||||||
FILE="$(realpath "${BASH_SOURCE[0]}")"
|
BASH_FILE="$(realpath "${BASH_SOURCE[0]}")"
|
||||||
DIRECTORY="$(dirname "${FILE}")"
|
BASH_ROOT="$(dirname "${BASH_FILE}")"
|
||||||
|
|
||||||
OUT='output'
|
OUTPUT='output'
|
||||||
|
|
||||||
function rs { echo; \
|
function rs { echo; \
|
||||||
echo "→ ${2} @ ${3} : ${1}"; \
|
echo "→ ${2} @ ${3} : ${1}"; \
|
||||||
ssh -o 'LogLevel Error' -p ${1} "${2}@${3}" \
|
ssh -o 'LogLevel Error' -p ${1} "${2}@${3}" \
|
||||||
df -h .
|
df --human-readable .
|
||||||
}
|
}
|
||||||
function rs {
|
function rs {
|
||||||
echo "→ ${2} @ ${3} : ${1}"
|
echo "→ ${2} @ ${3} : ${1}"
|
||||||
rsync --verbose --progress \
|
rsync --verbose --progress \
|
||||||
--rsh "ssh -o 'LogLevel Error' -p ${1}" \
|
--rsh "ssh -o 'LogLevel Error' -p ${1}" \
|
||||||
--archive --checksum --delete-before \
|
--archive --checksum --delete-before \
|
||||||
"${DIRECTORY}/${OUT}/" \
|
"${BASH_ROOT}/${OUTPUT}/" \
|
||||||
"${2}@${3}:${4}/" \
|
"${2}@${3}:${4}/" \
|
||||||
> /dev/null
|
> /dev/null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue