2023-12-13 21:25:13 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2024-06-23 21:23:05 +02:00
|
|
|
ynh_print_info "Declaring files to be backed up..."
|
2023-12-13 21:25:13 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP THE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-23 21:23:05 +02:00
|
|
|
ynh_backup "$install_dir"
|
2023-12-13 21:25:13 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-23 21:23:05 +02:00
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
2023-12-13 21:25:13 +01:00
|
|
|
|
2023-12-13 21:47:23 +01:00
|
|
|
#=================================================
|
|
|
|
# BACKUP FAIL2BAN CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-23 21:23:05 +02:00
|
|
|
ynh_backup "/etc/fail2ban/jail.d/$app.conf"
|
|
|
|
ynh_backup "/etc/fail2ban/filter.d/$app.conf"
|
2023-12-13 21:47:23 +01:00
|
|
|
|
2023-12-13 21:25:13 +01:00
|
|
|
#=================================================
|
|
|
|
# BACKUP SYSTEMD
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-23 21:23:05 +02:00
|
|
|
ynh_backup "/etc/systemd/system/$app.service"
|
2023-12-13 21:25:13 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP THE MYSQL DATABASE
|
|
|
|
#=================================================
|
2024-06-23 21:23:05 +02:00
|
|
|
ynh_print_info "Backing up the PostgreSQL database..."
|
2023-12-13 21:25:13 +01:00
|
|
|
|
2024-06-23 21:23:05 +02:00
|
|
|
ynh_psql_dump_db > db.sql
|
2023-12-13 21:25:13 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-23 21:23:05 +02:00
|
|
|
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|