2022-04-29 12:18:34 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_print_info "Declaring files to be backed up..."
|
2022-04-29 12:18:34 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP THE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_backup "$install_dir"
|
2022-04-29 12:18:34 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
2022-04-29 12:18:34 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP SYSTEMD
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_backup "/etc/systemd/system/${app}.service"
|
|
|
|
ynh_backup "/etc/systemd/system/${app}_workers.service"
|
2023-03-02 20:37:23 +01:00
|
|
|
|
2023-02-20 00:53:19 +01:00
|
|
|
#=================================================
|
|
|
|
# BACKUP THE POSTGRESQL DATABASE
|
|
|
|
#=================================================
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_print_info "Backing up the PostgreSQL database..."
|
2023-02-20 00:53:19 +01:00
|
|
|
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_psql_dump_db > db.sql
|
2023-02-20 00:53:19 +01:00
|
|
|
|
2022-04-29 12:18:34 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|