2019-11-19 13:09:31 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2022-01-27 02:21:23 +01:00
|
|
|
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
2019-11-19 13:09:31 +01:00
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2021-08-16 09:20:33 +02:00
|
|
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
2019-11-19 13:09:31 +01:00
|
|
|
#=================================================
|
2021-08-16 09:20:33 +02:00
|
|
|
ynh_print_info --message="Declaring files to be backed up..."
|
2019-11-19 13:09:31 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP THE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
|
2023-12-11 12:37:28 +01:00
|
|
|
ynh_backup --src_path="$install_dir"
|
2019-11-19 13:09:31 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
2019-11-19 20:51:09 +01:00
|
|
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/000-$app.conf"
|
2019-11-19 13:09:31 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC BACKUP
|
|
|
|
#=================================================
|
|
|
|
# BACKUP SYSTEMD
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
|
|
|
|
|
|
|
#=================================================
|
2022-01-27 02:21:23 +01:00
|
|
|
# BACKUP VARIOUS FILES
|
2019-11-19 13:09:31 +01:00
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_backup --src_path="/etc/systemd/system/$app.timer"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-08-16 09:20:33 +02:00
|
|
|
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|