aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robin Obůrka <r.oburka@gmail.com> 2016-07-31 14:50:42 +0200
committerGravatar Robin Obůrka <r.oburka@gmail.com> 2016-07-31 14:50:42 +0200
commit57cf0824d45615fe1857a6fd04dba09be62633db (patch)
tree3160b61deabe1a9a88641a03d4db3c1d17170943
parentUse batch mode for GPG (diff)
downloadbackuper-57cf0824d45615fe1857a6fd04dba09be62633db.tar.xz
Add command store_ssh
-rw-r--r--backuper.sh13
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"
}