2016-03-18 18:38:54 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-01-14 23:57:33 +01:00
|
|
|
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
2020-11-17 23:55:57 +01:00
|
|
|
source ../settings/scripts/_common.sh
|
2018-08-14 22:18:22 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-03-18 18:38:54 +01:00
|
|
|
|
2024-08-31 03:02:25 +02:00
|
|
|
ynh_print_info "Declaring files to be backed up..."
|
2018-08-14 22:18:22 +02:00
|
|
|
|
2022-01-14 23:57:33 +01:00
|
|
|
#=================================================
|
2024-01-30 23:33:35 +01:00
|
|
|
# SYSTEM CONFIGURATION
|
2022-01-14 23:57:33 +01:00
|
|
|
#=================================================
|
|
|
|
|
2024-01-30 23:33:35 +01:00
|
|
|
# Backup the nginx configuration
|
2024-08-31 03:02:25 +02:00
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
2022-01-14 23:57:33 +01:00
|
|
|
|
|
|
|
#=================================================
|
2024-01-30 23:33:35 +01:00
|
|
|
# BACKUP VARIOUS FILES
|
2022-01-14 23:57:33 +01:00
|
|
|
#=================================================
|
2020-12-06 21:39:09 +01:00
|
|
|
|
2024-01-30 23:33:35 +01:00
|
|
|
# Backup SOGo configuration
|
2024-08-31 03:02:25 +02:00
|
|
|
ynh_backup "/etc/$app"
|
2020-12-06 21:39:09 +01:00
|
|
|
|
2024-01-30 23:33:35 +01:00
|
|
|
# Backup cron
|
2024-08-31 03:02:25 +02:00
|
|
|
ynh_backup "/etc/cron.d/$app"
|
2019-06-07 23:09:30 +02:00
|
|
|
|
2024-01-30 23:33:35 +01:00
|
|
|
# Backup logs
|
2024-08-31 03:02:25 +02:00
|
|
|
ynh_backup "/var/log/$app"
|
2022-01-14 23:57:33 +01:00
|
|
|
|
|
|
|
#=================================================
|
2018-08-14 22:18:22 +02:00
|
|
|
# BACKUP THE MYSQL DATABASE
|
2022-01-14 23:57:33 +01:00
|
|
|
#=================================================
|
2024-08-31 03:02:25 +02:00
|
|
|
ynh_print_info "Backing up the MySQL database..."
|
2022-01-14 23:57:33 +01:00
|
|
|
|
2024-08-31 03:02:25 +02:00
|
|
|
ynh_mysql_dump_db > db.sql
|
2022-01-14 23:57:33 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2019-06-07 23:09:30 +02:00
|
|
|
|
2024-08-31 03:02:25 +02:00
|
|
|
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|