diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-06-01 17:38:44 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-06-01 18:55:50 +0300 |
commit | 1f1bc59f5347d162fc87cc09364fc4bcdad6d593 (patch) | |
tree | 092968b545576e6663fd442a1e5767580fb8db74 /lib | |
parent | 2878881412e0f73c5f98ca4fe728ba8deca9087f (diff) | |
download | beam-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')
-rw-r--r-- | lib/beam/common.in | 2 | ||||
-rwxr-xr-x | lib/beam/fs.sh | 2 | ||||
-rw-r--r-- | lib/beam/mysql.sh | 2 | ||||
-rwxr-xr-x | lib/beam/postgres.sh | 2 | ||||
-rw-r--r-- | lib/beam/s3.sh | 41 |
5 files changed, 24 insertions, 25 deletions
diff --git a/lib/beam/common.in b/lib/beam/common.in index 1d4dfd9..519b23a 100644 --- a/lib/beam/common.in +++ b/lib/beam/common.in @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This file is part of BEAM # Copyright (C) 2012 Sergey Poznyakoff # diff --git a/lib/beam/fs.sh b/lib/beam/fs.sh index 024b761..74553e3 100755 --- a/lib/beam/fs.sh +++ b/lib/beam/fs.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This file is part of BEAM # Copyright (C) 2012 Sergey Poznyakoff # diff --git a/lib/beam/mysql.sh b/lib/beam/mysql.sh index c33adb0..fd6e33c 100644 --- a/lib/beam/mysql.sh +++ b/lib/beam/mysql.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This file is part of BEAM # Copyright (C) 2012 Sergey Poznyakoff # diff --git a/lib/beam/postgres.sh b/lib/beam/postgres.sh index 0072da6..67769ce 100755 --- a/lib/beam/postgres.sh +++ b/lib/beam/postgres.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This file is part of BEAM # Copyright (C) 2012 Sergey Poznyakoff # 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 |