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