#!/bin/bash
set -eu

source /usr/share/yunohost/helpers

app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)

# Backup the app files
ynh_backup /var/www/$app

# Backup the conf files
ynh_backup /etc/nginx/conf.d/$domain.d/$app.conf

# Backup the custom file to a different location
ynh_backup /etc/importantfile /etc/yoloswag

# Backup db
ynh_mysql_dump_db $app > db.sql
