1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/flohmarkt_ynh.git synced 2024-09-03 18:36:30 +02:00
flohmarkt_ynh/scripts/backup
Chris Vogel 020dd4abfe avoid linter message
`! Using helper ynh_backup_before_upgrade is deprecated when using packaging v2 ... It is replaced by: nothing, handled by the core, just get rid of it`

I only use `ynh_backup_before_upgrade` in a comment. Try to cloak it by inserting some invisible space.

Removed debugging outpug from scripts/restore (after backing it up to branch debugging_restore.
2024-04-25 10:46:28 +02:00

39 lines
1.7 KiB
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$install_dir"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup --src_path="/opt/couchdb/etc/local.d/05-flohmarkt.ini"
ynh_backup --src_path="/etc/systemd/system/$app.service"
ynh_backup --src_path="/var/log/$app"
# for the following backups we'll want to stop flohmarkt and couchdb
# to guarentee a consistant state
ynh_print_info --message="Stopping flohmarkt and couchdb to backup data..."
yunohost service stop flohmarkt
systemctl stop couchdb
# 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
# --is_big 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 --src_path="$data_dir" --is_big
# ynh_backup --src_path="/var/lib/couchdb" --is_big
ynh_backup --src_path="$data_dir"
ynh_backup --src_path="/var/lib/couchdb"
ynh_print_info --message="...done. Starting couchdb and flohmarkt."
systemctl start couchdb
yunohost service start flohmarkt
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."