-
Notifications
You must be signed in to change notification settings - Fork 1
/
perform-tarsnap-backup.sh
executable file
·56 lines (40 loc) · 1.12 KB
/
perform-tarsnap-backup.sh
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
#!/bin/bash
# Move to the directory of the script that included this include file ------
export SCRIPT_LOCT=$( cd $( dirname $0 ); pwd )
cd $SCRIPT_LOCT
. dev-scripts/trtl-includes.sh
include_trtl_env_vars settings/trtl-env-var.sh
# -------
set -e
# Set the tarsnap key to $1 or to the value from env var file ------------
export_tarsnap_key $1
# Set lets encrypt dir to $2 or env var file ------------
export_letsencrypt_dir $2
# --------------------------------------------
if [ "$( is_certbot_enabled )" == "true" ]; then
echo
echo "* Backing up certbot files"
echo
cd $SCRIPT_LOCT/certbot-new/utils
./backup-certbot-to-tarsnap.sh "$TARSNAP_KEY_FILE" "$LE_DIR"
sleep 10s
fi
echo
echo "* Backing up postgres files"
echo
cd $SCRIPT_LOCT/postgres/utils
./backup-postgres-to-tarsnap.sh "$TARSNAP_KEY_FILE"
sleep 10s
echo
echo "* Backing up turtl-server files"
echo
cd $SCRIPT_LOCT/turtl-server/utils
./backup-turtl-server-to-tarsnap.sh "$TARSNAP_KEY_FILE"
sleep 10s
echo
echo "* Backing up settings files"
echo
cd $SCRIPT_LOCT/dev-scripts/settings-backup
./backup-settings-to-tarsnap.sh
sleep 10s
echo