forked from eduvpn/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackup.sh
executable file
·37 lines (32 loc) · 1023 Bytes
/
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
#!/bin/sh
#
# Backup
#
# NOTE: this script only backs-up the VPN configuration and data, NOT things
# like SAML configuration, installed LDAP certificates and/or network
# configuration.
#
# This is only for the installations performed with the "deploy_${DIST}.sh"
# scripts for the various platforms.
TMP_DIR=$(mktemp -d)
DATETIME=$(date +%Y%m%d%H%M%S)
tar --selinux -cpJf "${TMP_DIR}/backup-${DATETIME}.tar.xz" \
/etc/vpn-user-portal \
/etc/vpn-admin-portal \
/etc/vpn-server-api \
/etc/vpn-server-node \
/var/lib/vpn-user-portal \
/var/lib/vpn-admin-portal \
/var/lib/vpn-server-api
echo "${TMP_DIR}/backup-${DATETIME}.tar.xz"
#
# Restore (as root)
#
# first run the "deploy_${DIST}.sh" script, same as for a new deploy
#
# cd / && tar --selinux -xJf <file.tar.xz>
# vpn-server-node-server-config
# vpn-server-node-generate-firewall --install
#
# enable all the OpenVPN processes (systemctl) if necessary and start them!
# reboot server to make sure everything comes up as expected!