aboutsummaryrefslogtreecommitdiff
path: root/examples/backup.conf.s3
blob: 07b3d68ff2f6e5ddb4e906fa4d8ba8b71cab104c (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# -*- 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() {	
# 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";;
    *)       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
}

# 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"



Return to:

Send suggestions and report system problems to the System administrator.