2017-11-14 16:05:26 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-01-31 16:08:58 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
2022-03-13 15:22:35 +01:00
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2018-01-31 16:08:58 +01:00
|
|
|
|
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
|
|
|
|
|
2018-01-31 16:08:58 +01:00
|
|
|
#=================================================
|
2022-03-13 15:22:35 +01:00
|
|
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
2018-01-31 16:08:58 +01:00
|
|
|
#=================================================
|
2022-03-13 15:22:35 +01:00
|
|
|
ynh_print_info --message="Declaring files to be backed up..."
|
2018-01-31 16:08:58 +01:00
|
|
|
|
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"
|
|
|
|
|
2024-01-31 00:09:54 +01:00
|
|
|
# Backup hashed password
|
|
|
|
ynh_psql_execute_as_root --sql="SELECT rolpassword FROM pg_authid WHERE rolname='$app';" | head -3 | tail -1 > hashed_password.txt
|
|
|
|
|
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)."
|