2021-03-11 00:34:24 +01:00
#!/bin/bash
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
2024-02-28 22:22:42 +01:00
ynh_backup --src_path="$install_dir"
2021-03-11 00:34:24 +01:00
#=================================================
2024-02-28 22:22:42 +01:00
# BACKUP THE SYSTEM CONFIGURATION
2021-03-11 00:34:24 +01:00
#=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
2024-02-28 22:22:42 +01:00
ynh_backup --src_path="/var/log/$app/"
2021-03-11 00:34:24 +01:00
2024-02-28 22:22:42 +01:00
if [[ "$autosynchronize" == true ]]; then
# backup dato.ini config in couch
ynh_backup --src_path="/opt/couchdb/etc/local.d/$app.ini"
2021-03-11 00:34:24 +01:00
2024-02-28 22:22:42 +01:00
# notify that couchdb users and dbs are left
ynh_print_warn --message="Please note that backing up dato doesn't backup the databases you created through it. To backup your data, you should backup the couchdb app."
2021-03-11 00:34:24 +01:00
fi
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."