1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/sogo_ynh.git synced 2024-09-03 20:26:07 +02:00
sogo_ynh/scripts/backup

41 lines
1.1 KiB
Text
Raw Normal View History

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
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
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
ynh_backup "/etc/$app"
2020-12-06 21:39:09 +01:00
2024-01-30 23:33:35 +01:00
# Backup cron
ynh_backup "/etc/cron.d/$app"
2024-01-30 23:33:35 +01:00
# Backup logs
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
#=================================================
ynh_print_info "Backing up the MySQL database..."
2022-01-14 23:57:33 +01:00
ynh_mysql_dump_db > db.sql
2022-01-14 23:57:33 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."