aboutsummaryrefslogtreecommitdiff
path: root/lib/beam/s3.sh
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-06-01 17:38:44 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-06-01 18:55:50 +0300
commit1f1bc59f5347d162fc87cc09364fc4bcdad6d593 (patch)
tree092968b545576e6663fd442a1e5767580fb8db74 /lib/beam/s3.sh
parent2878881412e0f73c5f98ca4fe728ba8deca9087f (diff)
downloadbeam-1f1bc59f5347d162fc87cc09364fc4bcdad6d593.tar.gz
beam-1f1bc59f5347d162fc87cc09364fc4bcdad6d593.tar.bz2
Improve docs.
* NEWS: Update. * README: Rewrite. Provide enough documentation for startup. * doc/beam-cleaner.1in: New file. * doc/Makefile.am: Build and install beam-cleaner.1. * doc/beam-backup.1in: Fix the time-stamp-start variable. * doc/beam-restore.1in: Likewise. * doc/beam-s3.1in: Likewise. * doc/beam.conf.5in: Likewise. * backup.in: Mark with sh magic. * beam.in: Likewise. * lib/beam/common.in: Likewise. * lib/beam/fs.sh: Likewise. * lib/beam/mysql.sh: Likewise. * lib/beam/postgres.sh: Likewise. * lib/beam/s3.sh: Likewise. * restore.in: Likewise. * s3.in: Likewise.
Diffstat (limited to 'lib/beam/s3.sh')
-rw-r--r--lib/beam/s3.sh41
1 files changed, 20 insertions, 21 deletions
diff --git a/lib/beam/s3.sh b/lib/beam/s3.sh
index b365a54..39416d7 100644
--- a/lib/beam/s3.sh
+++ b/lib/beam/s3.sh
@@ -22,6 +22,24 @@ test -z "$backup_mp_s3backer" && backup_mp_s3backer=/mnt/s3backer
# The actual file system is mounted to /mnt/s3
test -z "$backup_mp" && backup_mp_s3=/mnt/s3
+s3_getmpoint()
+{
+ case $1 in
+ backer)
+ mount -tfuse.s3backer |
+ awk '/https?:\/\/'$backup_bucket_name'/ { print $3 }';;
+ s3)
+ s=$(mount | grep "^${backup_mp_s3backer}/file" | awk '{ print $3 }')
+ if [ -z "$s" ]; then
+ # Some kernels print device name instead of the actual mount file:
+ s=$(mount | grep "^/dev/loop[0-9] on ${backup_mp_s3}" | awk '{ print $3 }')
+ fi
+ echo $s;;
+ *)
+ abent 1 "invalid usage of getmpoint"
+ esac
+}
+
# This variable is populated by s3_mount and is used by s3_unmount to unmount
# s3-backed file system.
umount_list=""
@@ -34,8 +52,7 @@ s3_mount() {
# 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 }')
+ set -- $(s3_getmpoint backer)
if test -z "$1"; then
$dry_run s3backer $backup_s3backer_options \
$backup_bucket_name $backup_mp_s3backer ||
@@ -44,7 +61,7 @@ s3_mount() {
else
backup_mp_s3backer=$1
fi
- set -- $(mount | grep "^${backup_mp_s3backer}/file" | awk '{ print $3 }')
+ set -- $(s3_getmpoint s3)
if test -z "$1"; then
case $(basename $0) in
beam-restore|restore) mountopt=",ro";;
@@ -62,24 +79,6 @@ s3_mount() {
epilogue_hook="s3_unmount $epilogue_hook"
}
-s3_getmpoint()
-{
- case $1 in
- backer)
- mount -tfuse.s3backer |
- awk '/https?:\/\/'$backup_bucket_name'/ { print $3 }';;
- s3)
- s=$(mount | grep "^${backup_mp_s3backer}/file" | awk '{ print $3 }')
- if [ -z "$s" ]; then
- # Some kernels print device name instead of the actual mount file:
- s=$(mount | grep "^/dev/loop[0-9] on ${backup_mp_s3}" | awk '{ print $3 }')
- fi
- echo $s;;
- *)
- abent 1 "invalid usage of getmpoint"
- esac
-}
-
s3_unmount()
{
for id in s3 backer

Return to:

Send suggestions and report system problems to the System administrator.