aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac1
-rw-r--r--doc/beam.conf.5in27
-rw-r--r--examples/Makefile.am1
-rw-r--r--examples/backup.conf.s3143
-rwxr-xr-xlib/beam/fs.sh18
6 files changed, 44 insertions, 148 deletions
diff --git a/Makefile.am b/Makefile.am
index 8ebd47a..8d8a4ca 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS=. lib examples doc
+SUBDIRS=. lib doc
if COND_S3MOUNT
S3MOUNT=s3
S3MOUNT_SH=s3.sh
diff --git a/configure.ac b/configure.ac
index 56fd1af..ee36499 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,5 +33,4 @@ AM_CONDITIONAL([COND_S3MOUNT],[test "$s3_status"=yes])
AC_OUTPUT(Makefile
lib/Makefile
lib/beam/Makefile
- examples/Makefile
doc/Makefile)
diff --git a/doc/beam.conf.5in b/doc/beam.conf.5in
index 17d116b..0c38cb8 100644
--- a/doc/beam.conf.5in
+++ b/doc/beam.conf.5in
@@ -193,6 +193,33 @@ The absolute path to the file system being backed up.
A whitespace-separated list of directories and/or files in the
.B \fIitem\fB_dir
directory.
+.TP
+.B \fIitem\fB_exclude
+A whitespace-separated list of file names (or
+.BR glob (3)
+patterns) to exclude from archivation. This is translated to
+a list of
+.B \-\-exclude
+options to
+.BR tar (1).
+Make sure to quote globbing patterns as you would have done in shell,
+to prevent them from being expanded too early. For example:
+.sp
+.nf
+.in +2
+system_exclude="'var/spool/mail/*'"
+.in
+.fi
+.sp
+.TP
+.B \fIitem\fB_exclude_from
+A list of files to read exclusion patterns from. It is translated
+into a list of
+.B \-\-exclude\-from
+options.
+.TP
+.B \fIitem\fB_tar_options
+A list of additional options to pass to tar. Use this with caution.
.PP
For example:
.sp
diff --git a/examples/Makefile.am b/examples/Makefile.am
deleted file mode 100644
index c5a0a76..0000000
--- a/examples/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST=backup.conf.s3
diff --git a/examples/backup.conf.s3 b/examples/backup.conf.s3
deleted file mode 100644
index 668a383..0000000
--- a/examples/backup.conf.s3
+++ /dev/null
@@ -1,143 +0,0 @@
-# -*- shell-script -*-
-# This is an example configuration for backing up to an s3 mount.
-# It uses s3backer to mount the s3 bucket.
-#
-# Search for strings matching @.*@ and follow the comments to replace
-# them with your actual values.
-#
-# For a detailed information about backup.conf format, see backup.conf(5)
-# To debug the configuration, run "backup --dry-run" and "restore --dry-run".
-# For a detailed descriptions of these commands, see backup(1).
-
-# Set your s3 bucket name here
-backup_bucket_name=@YOUR-BUCKET-NAME@
-
-# Raw bucket is mounted to /mnt/s3backer
-mp_s3backer=/mnt/s3backer
-# The actual file system is mountet to /mnt/s3
-mp_s3=/mnt/s3
-
-# Make sure both mountpoints exist
-test -d $mp_s3backer || mkdir mp_s3backer
-test -d $mp_s3 || mkdir mp_s3backer
-
-# This variable is populated by prologue and is used by epilogue to unmount
-# s3-backed file system.
-umount_list=""
-
-# Prologue function is responsible for mounting the s3-backed fs.
-prologue() {
- local cleanup=1
-
-# Sample mount output, split into several lines:
-# http://finox-backup-fs.s3.amazonaws.com/ on /mnt/s3backer type fuse.s3backer
-# (rw,nosuid,nodev,allow_other,default_permissions)
- set -- $(mount -tfuse.s3backer |
- awk '/https?:\/\/'$backup_bucket_name'/ { print $3 }')
- if test -z "$1"; then
- $dry_run s3backer --accessFile=/root/.s3backer_passwd --vhost \
- $backup_bucket_name $mp_s3backer ||
- abend 1 "unable to mount $backup_bucket_name"
- umount_list="$mp_s3backer"
- else
- mp_s3backer=$1
- fi
- set -- $(mount | grep "^${mp_s3backer}/file" | awk '{ print $3 }')
- if test -z "$1"; then
- case $(basename $0) in
- restore) mountopt=",ro";;
- backup) mountopt=",rw,data=writeback";;
- s3mount) cleanup=0;;
- *) error "called as $0: assuming default mount options"
- esac
- # NOTE: For ext4 add the journal_async_commit option.
- $dry_run mount -oloop$mountopt $mp_s3backer/file $mp_s3 ||
- abend 1 "unable to mount $mp_s3backer/file"
- umount_list="$mp_s3 $umount_list"
- else
- mp_s3=$1
- fi
- if test $cleanup -eq 1; then
- backup-cleanup --verbose --suffix .tar.bz2 $mp_s3
- backup-cleanup --verbose --suffix .db $backup_snapshot_dir
- fi
-}
-
-# Epilogue function unmounts all fs mounted so far.
-epilogue() {
- for mp in $umount_list
- do
- $dry_run umount $mp
- done
-}
-
-# Initialize hooks.
-prologue_hook=prologue
-epilogue_hook=epilogue
-
-##########################################################################
-# Tar setup.
-#
-# Tar setup variables configure invocation of tar.
-#
-##########################################################################
-
-# Any additional options to pass to tar. Do not place tar operation
-# switches (as -c, -t, etc.) here! These will be added automatically
-# by appropriate scripts, depending on the operation being performed.
-#
-# By default this variable is empty (no additional options).
-#
-# In this example it is used to request bzip2 compression:
-backup_tar_options="-b1000 -j"
-
-# Suffix for archive files.
-# Default is "tar"
-#
-backup_suffix="tar.bz2"
-
-# Directory where archive files are to be located. It's OK to specify
-# a remote directory here, e.g. 10.10.0.1:/export/backup
-#
-# This variable must be set. Whatever directory it points to must already
-# exist, the backup script won't create it.
-backup_archive_dir=$mp_s3
-
-# Directory where to store snapshot files. The files will be named as
-# their archive counterparts, with the suffix ".db".
-#
-# This variable must be set
-backup_snapshot_dir=@YOUR-SNAPSHOT-DIR@
-
-# Set this variable to a non-empty value if you wish backup procedures to
-# be verbose.
-backup_verbose=
-
-##########################################################################
-# Backup items.
-#
-# Backup items are symbolic names that identify abstract objects that
-# need to be backed up (or restored). These must be valid shell variable
-# names. For each backup item <name>, this configuration file defines a
-# set of variables which determine what files to backup and what methods
-# to use for that. Each such variable is named <name>_<variable>, where
-# <name> is the item name, and <variable> is the variable name. The set
-# of variables needed depends on the type of each particular item.
-#
-##########################################################################
-
-backup_items="dbdump index repo"
-
-dbdump_type=postgres
-dbdump_database="alfresco"
-
-index_type=fs
-index_dir="/export/data/alfresco"
-index_files="backup-lucene-indexes"
-
-repo_type=fs
-repo_dir="/export/data/alfresco"
-repo_files="contentstore oouser contentstore.deleted"
-
-
-
diff --git a/lib/beam/fs.sh b/lib/beam/fs.sh
index 6d7d4c7..024b761 100755
--- a/lib/beam/fs.sh
+++ b/lib/beam/fs.sh
@@ -57,19 +57,33 @@ fs_check() {
# fs_backup item
fs_backup() {
- local basename text root files
+ local basename text root files exclude addopts s e
basename=$1-$week-$round-$level
eval text=\$${1}_text
eval root=\$${1}_dir
eval files=\$${1}_files
+ eval addopts=\$${1}_tar_options
+
+ eval exclude=\$${1}_exclude
+ for e in $exclude
+ do
+ eval s="$e"
+ addopts="$addopts --exclude=$s"
+ done
+
+ eval exclude=\$${1}_exclude_from
+ for e in $exclude
+ do
+ addopts="$addopts --exclude-from=$e"
+ done
test -z "$root" && abend 1 "${1}_dir not set"
test -z "$files" && abend 1 "${1}_files not set"
test -z "$text" && text="$1"
initdb $1
logit "backing up $text ($basename.$tar_suffix)"
- $dry_run tar $verbose $taroptions \
+ $dry_run tar $verbose $taroptions $addopts \
-f $backup_archive_dir/$basename.$tar_suffix \
--listed=$backup_snapshot_dir/$basename.db \
-C $root $files

Return to:

Send suggestions and report system problems to the System administrator.