1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pgadmin_ynh.git synced 2024-09-03 19:56:38 +02:00
pgadmin_ynh/scripts/backup

72 lines
2.2 KiB
Text
Raw Normal View History

2017-11-14 16:05:26 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
2022-03-13 15:22:35 +01:00
# IMPORT GENERIC HELPERS
#=================================================
2022-03-13 15:22:35 +01:00
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
2020-11-17 23:51:51 +01:00
source ../settings/scripts/experimental_helper.sh
source ../settings/scripts/_common.sh
2017-11-14 16:05:26 +01:00
source /usr/share/yunohost/helpers
2022-03-13 15:22:35 +01:00
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
true
}
2017-11-14 16:05:26 +01:00
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
2022-03-13 15:22:35 +01:00
#=================================================
2017-11-14 16:05:26 +01:00
# LOAD SETTINGS
2022-03-13 15:22:35 +01:00
#=================================================
ynh_print_info --message="Loading installation settings..."
2022-03-13 15:22:35 +01:00
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
2017-11-14 16:05:26 +01:00
#=================================================
2022-03-13 15:22:35 +01:00
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
2022-03-13 15:22:35 +01:00
ynh_print_info --message="Declaring files to be backed up..."
2022-03-13 15:22:35 +01:00
#=================================================
2017-11-14 16:05:26 +01:00
# BACKUP THE APP MAIN DIR
2022-03-13 15:22:35 +01:00
#=================================================
ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
2017-11-14 16:05:26 +01:00
2022-03-13 15:22:35 +01:00
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
2017-11-14 16:05:26 +01:00
2022-03-13 15:22:35 +01:00
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
2019-06-06 22:39:49 +02:00
2022-03-13 15:22:35 +01:00
ynh_backup --src_path="/etc/logrotate.d/$app"
2019-06-06 22:39:49 +02:00
2022-03-13 15:22:35 +01:00
#=================================================
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="/etc/uwsgi/apps-available/$app.ini"
ynh_backup --src_path="/var/lib/pgadmin"
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."