From d438f71bbbb2dd232e2bb3b5071583f4b34c5ac6 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 20 Oct 2023 20:25:43 +0000 Subject: [PATCH] add assets --- backup.sh | 5 +++++ restore.sh | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/backup.sh b/backup.sh index 8f0d20d7..7b580266 100755 --- a/backup.sh +++ b/backup.sh @@ -68,6 +68,7 @@ mkdir ${tmp_dir}/nginx mkdir ${tmp_dir}/systemd mkdir ${tmp_dir}/rmm mkdir ${tmp_dir}/confd +mkdir ${tmp_dir}/opt POSTGRES_USER=$(/rmm/api/env/bin/python /rmm/api/tacticalrmm/manage.py get_config dbuser) POSTGRES_PW=$(/rmm/api/env/bin/python /rmm/api/tacticalrmm/manage.py get_config dbpw) @@ -93,6 +94,10 @@ if [ -d /etc/letsencrypt ]; then sudo tar -czvf ${tmp_dir}/certs/etc-letsencrypt.tar.gz -C /etc/letsencrypt . fi +if [ -d /opt/tactical ]; then + sudo tar -czvf ${tmp_dir}/opt/opt-tactical.tar.gz -C /opt/tactical . +fi + local_settings='/rmm/api/tacticalrmm/tacticalrmm/local_settings.py' if grep -q CERT_FILE "$local_settings"; then diff --git a/restore.sh b/restore.sh index e91ef26a..02f6604e 100755 --- a/restore.sh +++ b/restore.sh @@ -220,6 +220,17 @@ elif [ -d "${tmp_dir}/certs/selfsigned" ]; then cp -p ${tmp_dir}/certs/selfsigned/cert.pem $certdir fi +print_green 'Restoring assets' +if [ -f "$tmp_dir/opt/opt-tactical.tar.gz" ]; then + sudo mkdir -p /opt/tactical + sudo tar -xzf $tmp_dir/opt/opt-tactical.tar.gz -C /opt/tactical + sudo chown ${USER}:${USER} -R /opt/tactical +else + sudo mkdir -p /opt/tactical/reporting/assets + sudo mkdir -p /opt/tactical/reporting/schemas + sudo chown -R ${USER}:${USER} /opt/tactical +fi + print_green 'Restoring celery configs' sudo mkdir /etc/conf.d