2018-05-11 21:38:56 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-04-03 14:35:09 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
2018-05-11 21:38:56 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_print_info "Declaring files to be backed up..."
|
2020-12-04 16:56:37 +01:00
|
|
|
|
2018-05-11 21:38:56 +02:00
|
|
|
#=================================================
|
|
|
|
# BACKUP THE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_backup "$install_dir"
|
2018-05-11 21:38:56 +02:00
|
|
|
|
2021-08-04 23:53:34 +02:00
|
|
|
#=================================================
|
|
|
|
# BACKUP THE DATA DIR
|
|
|
|
#=================================================
|
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_backup "$data_dir"
|
2021-08-04 23:53:34 +02:00
|
|
|
|
2018-05-11 21:38:56 +02:00
|
|
|
#=================================================
|
|
|
|
# BACKUP THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d"
|
2018-05-11 21:38:56 +02:00
|
|
|
|
|
|
|
#=================================================
|
2021-04-16 14:14:27 +02:00
|
|
|
# BACKUP FAIL2BAN CONFIGURATION
|
2018-05-11 21:38:56 +02:00
|
|
|
#=================================================
|
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_backup "/etc/fail2ban/jail.d/$app.conf"
|
|
|
|
ynh_backup "/etc/fail2ban/filter.d/$app.conf"
|
2018-05-11 21:38:56 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC BACKUP
|
|
|
|
#=================================================
|
|
|
|
# BACKUP SYSTEMD
|
|
|
|
#=================================================
|
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_backup "/etc/systemd/system/${app}-beat.service"
|
|
|
|
ynh_backup "/etc/systemd/system/${app}-server.service"
|
|
|
|
ynh_backup "/etc/systemd/system/${app}-worker.service"
|
|
|
|
ynh_backup "/etc/systemd/system/$app.target"
|
2019-04-03 14:35:09 +02:00
|
|
|
|
2021-04-16 14:14:27 +02:00
|
|
|
#=================================================
|
|
|
|
# BACKUP THE POSTGRESQL DATABASE
|
|
|
|
#=================================================
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_print_info "Backing up the PostgreSQL database..."
|
2021-04-16 14:14:27 +02:00
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_psql_dump_db > db.sql
|
2021-04-16 14:14:27 +02:00
|
|
|
|
2019-04-03 14:35:09 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|