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

51 lines
1.7 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
# 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
#=================================================
2024-01-30 16:37:46 +01:00
# SYSTEM CONFIGURATION
2022-03-13 15:22:35 +01:00
#=================================================
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
ynh_backup --src_path="/etc/logrotate.d/$app"
2019-06-06 22:39:49 +02:00
2024-01-30 16:37:46 +01:00
ynh_backup --src_path="/etc/uwsgi/apps-available/$app.ini"
2022-03-13 15:22:35 +01:00
#=================================================
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="/var/lib/pgadmin"
# Backup hashed password
ynh_psql_execute_as_root --sql="SELECT rolpassword FROM pg_authid WHERE rolname='$app';" | head -3 | tail -1 > hashed_password.txt
2024-01-31 14:52:39 +01:00
ynh_backup --src_path="/var/log/pgadmin"
2022-03-13 15:22:35 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."