aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-06-26 11:53:20 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-06-26 11:53:20 +0300
commit3932856031189f0c242483068cdd8eaf44429fc8 (patch)
tree7a558e9a394e13bf0fb68faf03bfd71ebeaa71c6
parent9e95716abf0a45e0ee11b1a313f684df71d7188a (diff)
downloadbeam-3932856031189f0c242483068cdd8eaf44429fc8.tar.gz
beam-3932856031189f0c242483068cdd8eaf44429fc8.tar.bz2
Provide a new hook, to be run prior to opening the log file.
* backup.in (backup): Run openlog_hook. * beam.conf (openlog_hook): Document the hook. * doc/beam.conf.5in: Likewise. * lib/beam/common.in (load_config): Insert s3_mount at the beginning of the prologue_hook.
-rw-r--r--backup.in1
-rw-r--r--beam.conf4
-rw-r--r--doc/beam.conf.5in4
-rw-r--r--lib/beam/common.in3
4 files changed, 11 insertions, 1 deletions
diff --git a/backup.in b/backup.in
index 55fa323..046953d 100644
--- a/backup.in
+++ b/backup.in
@@ -122,6 +122,7 @@ backup() {
}
if [ -n "$backup_logfile" ]; then
+ runhook openlog_hook
exec >>$backup_logfile
exec 2>&1
fi
diff --git a/beam.conf b/beam.conf
index 5bdec80..e6a7403 100644
--- a/beam.conf
+++ b/beam.conf
@@ -19,6 +19,10 @@ echo >&2 "$0: WARNING: using default configuration boilerplate"
# commands to be invoked. These commands will be invoked without arguments
# and run in order of their appearance in the list.
+# Commands listed in openlog_hook are run before opening the logfile. The
+# most common use for this hook is to rotate an oversized logfile prior to
+# opening it.
+openlog_hook=
# The prologue_hook is a list of commands to run before starting backup
# (or restore).
prologue_hook=
diff --git a/doc/beam.conf.5in b/doc/beam.conf.5in
index e76dd14..840b75a 100644
--- a/doc/beam.conf.5in
+++ b/doc/beam.conf.5in
@@ -352,6 +352,10 @@ Defines the mailer program. The default is
Two special variables, called hooks, allow you to supply arbitrary
commands to be run before and after backup.
.TP
+.B openlog_hook
+Commands listed in this variable are run before opening the logfile. The
+most common use for this hook is to rotate an oversized logfile prior to
+opening it.
.B prologue_hook
This variable contains a whitespace-separated list of commands to
be invoked before starting backup (or restore). These commands are
diff --git a/lib/beam/common.in b/lib/beam/common.in
index 519b23a..b9df1b0 100644
--- a/lib/beam/common.in
+++ b/lib/beam/common.in
@@ -19,6 +19,7 @@
LC_ALL=C
export LC_ALL
+openlog_hook=
prologue_hook=
epilogue_hook=
@@ -101,7 +102,7 @@ $type"
if [ -n "$backup_bucket_name" ]; then
. @LIBDIR@/beam/s3.sh
- prologue_hook="$prologue_hook s3_mount"
+ prologue_hook="s3_mount $prologue_hook"
fi
}

Return to:

Send suggestions and report system problems to the System administrator.