blob: c6e508357a5e48e9a88e886c9b5bc00351b323de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#! /bin/bash
set -e
test -z "$BACKUP_CONFIG" && BACKUP_CONFIG=@SYSCONFDIR@/backup.conf
if [ ! -r $BACKUP_CONFIG ]; then
echo >&2 "$0: configuration file $BACKUP_CONFIG is not found or is unreadable"
exit 1
fi
. @LIBDIR@/backup/common.sh
. $BACKUP_CONFIG
. @LIBDIR@/backup/s3.sh
if [ -z "$backup_bucket_name" ]; then
echo >&2 "$0: backup_bucket_name is not defined (examine $BACKUP_CONFIG)"
exit 1
fi
case $1 in
start)
s3_mount
echo "$backup_bucket_name mounted under $backup_mp_s3";;
stop)
s3_unmount;;
status)
for id in s3 backer
do
mpoint=$(s3_getmpoint $id)
if [ -n "$mpoint" ]; then
echo "$id is mounted on $mpoint"
fi
done;;
*)
echo "$0 mounts or unmounts a backup s3 bucket, as configured in $BACKUP_CONFIG"
echo "usage: $0 start|stop"
esac
|