aboutsummaryrefslogtreecommitdiff
path: root/lib/beam/common.in
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2014-03-18 23:17:42 +0200
committerSergey Poznyakoff <gray@gnu.org>2014-03-18 23:33:29 +0200
commit10d30373c6fdf0dd23f16251fa2302c18b7eef97 (patch)
tree5a87a201d719266e6917758f1325f2b8820ce81b /lib/beam/common.in
parentb731a0350721ec4a11959446fac93962394711b3 (diff)
downloadbeam-10d30373c6fdf0dd23f16251fa2302c18b7eef97.tar.gz
beam-10d30373c6fdf0dd23f16251fa2302c18b7eef97.tar.bz2
Allow for dumping each MySQL database into a separate file.
* lib/beam/common.in (load_config): Set beam_rsh and backup_local_archive_dir. (beam_exec): New function. * lib/beam/mysql.sh (dump_mysql_db) (restore_mysql_db): New functions. (mysql_backup,mysql_restore): Dump databases individually, depending on the value of <item>_alldb variable. * restore.in: Use beam_exec to run find. * doc/beam.conf.5in: Document changes.
Diffstat (limited to 'lib/beam/common.in')
-rw-r--r--lib/beam/common.in23
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/beam/common.in b/lib/beam/common.in
index e99433e..4f2184b 100644
--- a/lib/beam/common.in
+++ b/lib/beam/common.in
@@ -1,6 +1,6 @@
#! /bin/sh
# This file is part of BEAM
-# Copyright (C) 2012 Sergey Poznyakoff
+# Copyright (C) 2012-2014 Sergey Poznyakoff
#
# BEAM is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -76,7 +76,7 @@ tarcode() {
}
load_config() {
- local delayed_exit
+ local delayed_exit remote
test -z "$BEAM_CONFIG" && BEAM_CONFIG=@SYSCONFDIR@/beam.conf
if [ -r $BEAM_CONFIG ]; then
@@ -130,6 +130,25 @@ $type"
. @LIBDIR@/beam/s3.sh
prologue_hook="s3_mount $prologue_hook"
fi
+
+ remote=${backup_archive_dir%%:*}
+ if [ "$remote" != "$backup_archive_dir" ]; then
+ beam_rsh="${backup_rsh:-ssh} $remote"
+ backup_local_archive_dir=${backup_archive_dir#*:}
+ else
+ beam_rsh=
+ backup_local_archive_dir=$backup_archive_dir
+ fi
+}
+
+beam_exec() {
+ if [ -z "$beam_rsh" ]; then
+ set -- $(echo "$@" | sed 's/\\\\\([bcfnrtv0]\)/\\\1/g')
+ "$@"
+ else
+ set -- $(echo "$@" | sed 's/\\\\\([bcfnrtv0]\)/\\\1/g;s/[]\[\\\*]/\\&/g')
+ $beam_rsh "$@"
+ fi
}
runhook() {

Return to:

Send suggestions and report system problems to the System administrator.