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.3 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
#=================================================
2024-01-30 11:36:14 +01:00
#REMOVEME? ynh_clean_setup () {
2022-03-13 15:22:35 +01:00
true
}
2017-11-14 16:05:26 +01:00
# Exit if an error occurs during the execution of the script
2024-01-30 11:36:14 +01:00
#REMOVEME? ynh_abort_if_errors
2017-11-14 16:05:26 +01:00
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
#=================================================
2024-01-30 11:36:14 +01:00
#REMOVEME? ynh_print_info --message="Loading installation settings..."
2022-03-13 15:22:35 +01:00
2024-01-30 11:36:14 +01:00
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
2022-03-13 15:22:35 +01:00
2024-01-30 11:36:14 +01:00
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
#REMOVEME? 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
#=================================================
2024-01-30 11:36:14 +01:00
ynh_backup --src_path="$install_dir"
2022-03-13 15:22:35 +01:00
#=================================================
# 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)."