#!/bin/bash source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers ynh_print_info "Declaring files to be backed up..." ynh_backup "$flohmarkt_install" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup "/etc/fail2ban/jail.d/$app.conf" ynh_backup "/etc/fail2ban/filter.d/$app.conf" ynh_backup "/etc/logrotate.d/$app" ynh_backup "/opt/couchdb/etc/local.d/05-flohmarkt.ini" ynh_backup "/etc/systemd/system/$flohmarkt_filename.service" ynh_backup "${flohmarkt_cron_job}" ynh_backup "${flohmarkt_log_dir}" # for the following backups we'll want to stop flohmarkt and couchdb # to guarentee a consistant state ynh_print_info "Stopping flohmarkt to backup data..." flohmarkt_ynh_stop_service # https://codeberg.org/ChriChri/flohmarkt_ynh/issues/24 # since this might be re-installed as a dependency during 'remove' and # 'install' anew (like after a failed upgrade) we do not want to use # even thought the directories might be big because: # "don't want that your package does backup that part during ynh_backup_before_upgrade" # https://yunohost.org/en/packaging_apps_scripts_helpers#ynh-backup # # if this becomes a pain we'll need to stop deleting this directories on 'remove' # ynh_backup "$data_dir" ynh_backup "$flohmarkt_data_dir" ynh_print_info "Dumping couchdb..." flohmarkt_ynh_dump_couchdb ynh_print_info "Starting flohmarkt..." flohmarkt_ynh_start_service ynh_print_info "Backup script completed for $app."