2017-07-23 17:46:25 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-05-04 11:43:51 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
2017-07-23 17:46:25 +02:00
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2022-05-28 01:29:55 +02:00
|
|
|
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
2020-07-18 11:46:45 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
2017-07-23 17:46:25 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2018-05-04 11:43:51 +02:00
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
2017-07-23 17:46:25 +02:00
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
ynh_print_info --message="Declaring files to be backed up..."
|
|
|
|
|
2017-07-23 17:46:25 +02:00
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
# BACKUP THE APP MAIN DIR
|
2017-07-23 17:46:25 +02:00
|
|
|
#=================================================
|
|
|
|
|
2023-03-12 08:24:05 +01:00
|
|
|
ynh_backup --src_path="$install_dir"
|
2017-07-23 17:46:25 +02:00
|
|
|
|
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
# BACKUP THE NGINX CONFIGURATION
|
2017-07-23 17:46:25 +02:00
|
|
|
#=================================================
|
|
|
|
|
2020-07-18 11:46:45 +02:00
|
|
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
2017-07-23 17:46:25 +02:00
|
|
|
|
2017-07-30 21:33:54 +02:00
|
|
|
#=================================================
|
2021-11-27 12:10:20 +01:00
|
|
|
# SPECIFIC BACKUP
|
2017-07-30 21:33:54 +02:00
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
# BACKUP SYSTEMD
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
2017-07-30 21:33:54 +02:00
|
|
|
|
2017-07-23 17:46:25 +02:00
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
# END OF SCRIPT
|
2017-07-23 17:46:25 +02:00
|
|
|
#=================================================
|
|
|
|
|
2021-09-19 08:33:36 +02:00
|
|
|
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|