aboutsummaryrefslogtreecommitdiff
path: root/lib/beam/s3.sh
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-03-21 13:34:51 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-03-21 13:34:51 +0200
commit6c6ab3125da430bdaafb9bacc88c32279a961525 (patch)
treeef8f4005504a8545eaab5b111890649ba0302d2c /lib/beam/s3.sh
parent194f4b1204d6e49ba0af7dd761f8c794ba37c035 (diff)
downloadbeam-6c6ab3125da430bdaafb9bacc88c32279a961525.tar.gz
beam-6c6ab3125da430bdaafb9bacc88c32279a961525.tar.bz2
Prevent reentrant invocations. Minor bugfix.
At startup a pid file is checked. If it exists, another beam process is assumed to be running and start up is aborted. Otherwise a new pid file is created. The existing pid is removed before exiting (by epilogue_hook). * backup.in (prologue_hook): Prepend beam_lock. * lib/beam/common.in (backup_pidfile): New global. (beam_lock,beam_unlock): New functions. * lib/beam/s3.sh (s3_getmpoint): Fix regexp to take into account s3backer invocation without --vhost.
Diffstat (limited to 'lib/beam/s3.sh')
-rw-r--r--lib/beam/s3.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/beam/s3.sh b/lib/beam/s3.sh
index de71456..d2fcfe6 100644
--- a/lib/beam/s3.sh
+++ b/lib/beam/s3.sh
@@ -26,9 +26,16 @@ test -z "$backup_mp" && backup_mp_s3=/mnt/s3
s3_getmpoint()
{
case $1 in
+# Sample mount output, split into several lines:
+# a) With --vhost:
+# http://BUCKETNAME.s3.amazonaws.com/ on /mnt/s3backer type fuse.s3backer
+# (rw,nosuid,nodev,allow_other,default_permissions)
+# b) Without --vhost:
+# http://s3.amazonaws.com/BUCKETNAME/ on /mnt/s3backer type fuse.s3backer
+# (rw,nosuid,nodev,allow_other,default_permissions)
backer)
mount -tfuse.s3backer |
- awk '/https?:\/\/'$backup_bucket_name'/ { print $3 }';;
+ awk '/https?:\/\/.*'$backup_bucket_name'/ { print $3 }';;
s3)
s=$(mount | grep "^${backup_mp_s3backer}/file" | awk '{ print $3 }')
if [ -z "$s" ]; then
@@ -50,9 +57,6 @@ s3_mount() {
test -d $backup_mp_s3backer || mkdir $backup_mp_s3backer
test -d $backup_mp_s3 || mkdir $backup_mp_s3
-# 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 -- $(s3_getmpoint backer)
if test -z "$1"; then
$dry_run s3backer $backup_s3backer_options \

Return to:

Send suggestions and report system problems to the System administrator.