-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.env
60 lines (54 loc) · 2.25 KB
/
example.env
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
###############
# Example .env file for Mastodon backup scripts
#
# This may not be an extensive list of all possible ENV vars,
# please look at core.sh, pgbackup.sh, and sitebackup.sh for
# other possible ENV vars
#
# A variable wrapped with : ${somevar="1"} means it can be overriden
# from the command line ENV vars, e.g. PG_VERBOSE=1 ./pgbackup.sh
###############
# script-wide verbose toggle - can also specify '-v' on command line to enable verbose
# or '-q' to disable verbose if it's enabled via env var
: ${VERBOSE=0}
# Make postgres be verbose when dumping the DB
: ${PG_VERBOSE=0}
# Base backup folder
: ${BK_DIR_BASE="/backups/mastodon"}
# rclone remote destination
: ${REMOTE_DIR_BASE="backup:"}
: ${DATE_FORMAT="+%Y-%m-%d_%H%M"}
: ${CUR_DATE="$(date "$DATE_FORMAT")"}
# Output filename/directory name - may be automatically altered to add .tar.gz/bz2 to the end
# if APPEND_FTYPE=1 for site backups
: ${OUT_FILE_NAME="${CUR_DATE}"}
# (int) Delete local backups that are older than DELETE_AFTER days
: ${DELETE_AFTER=5}
# (str) Delete remote backups that are older than DELETE_AFTER_REMOTE amount of time, should
# be suffixed with d (days), M (months), m (minutes), h (hours), w (weeks)
: ${DELETE_AFTER_REMOTE="90d"}
# (int 1-9) Compression level to use - both DB + Site backups
: ${BK_COMPRESS_LEVEL="9"}
# (bool int) Enable/Disable RClone progress indication - by default we map this to VERBOSE,
# so progress is auto-enabled when VERBOSE is 1
: ${RCLONE_PROGRESS="$VERBOSE"}
####
# Site specific configs
####
# Location of the Mastodon application directory - for site backups
SITE_DIR="/home/mastodon/live"
# Backup method / compression for site backups - can be: bz2, gzip, lz4
: ${BK_TYPE_SITE="bz2"}
# (bool int) Automatically append .tar.gz/bz2 etc. if OUT_FILE doesn't contain it - for site backup only
: ${APPEND_FTYPE=1}
# Files/folders to exclude from the site Tar file, separated by ':'
: ${BK_EXCLUDE="${SITE_DIR}/public/system/cache:live/public/system/cache:public/system/cache"}
####
# DB specific configs
####
: ${DB_USER="mastodon"}
: ${DB_NAME="mastodon_production"}
# Backup type (format) for Postgres backups - can be: d (Directory), p (Plain), t (Tar), c (Custom)
: ${BK_TYPE_PG="d"}
# (bool int) Whether or not to compress DB backups
: ${BK_COMPRESS="1"}