#!/bin/bash #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get "$app" final_path) domain=$(ynh_app_setting_get "$app" domain) db_name=$(ynh_app_setting_get "$app" db_name) #================================================= # STANDARD BACKUP STEPS #================================================= # BACKUP THE APP MAIN DIR #================================================= ynh_backup "$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PostgreSQL DATABASE #================================================= ynh_psql_dump_db "$db_name" > db.sql ynh_backup "db.sql" #================================================= # SPECIFIC BACKUP #================================================= # BACKUP THE CRON FILE #================================================= ynh_backup "/etc/cron.d/$app" #================================================= # BACKUP THE uwsgi files #================================================= ynh_backup "/etc/uwsgi/apps-available/$app.ini" ynh_backup "/etc/systemd/system/$app.service" ynh_backup "/etc/systemd/system/$app-celery.service" #================================================= # BACKUP THE hub binary file #================================================= ynh_backup /usr/bin/hub