diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2016-07-31 14:50:42 +0200 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2016-07-31 14:50:42 +0200 |
commit | 57cf0824d45615fe1857a6fd04dba09be62633db (patch) | |
tree | 3160b61deabe1a9a88641a03d4db3c1d17170943 /backuper.sh | |
parent | Use batch mode for GPG (diff) | |
download | backuper-57cf0824d45615fe1857a6fd04dba09be62633db.tar.xz |
Add command store_ssh
Diffstat (limited to 'backuper.sh')
-rw-r--r-- | backuper.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/backuper.sh b/backuper.sh index c4797b5..12c2130 100644 --- a/backuper.sh +++ b/backuper.sh @@ -157,6 +157,19 @@ store_file() { store "sh -c 'cat > ${DST}/${FILENAME}'" } +## This is not standart feature but it is common for several project I know +store_ssh() { + [ -z "$1" ] && error "Specify server" + CONNECTION="$1" + + add_custom_stage "echo_and_copy "$FILENAME"" + store "ssh "$CONNECTION"" +} + +echo_and_copy() { + echo "$1" ; cat +} + add_custom_stage() { echo "$@" >> "$RUNDIR"/"$CUSTOM_STAGE_FILE" } |