2024-02-21 16:50:15 +01:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
|
|
ynh_print_info --message="Declaring files to be backed up..."
|
2024-05-06 07:47:13 +02:00
|
|
|
|
ynh_backup --src_path="$flohmarkt_install"
|
2024-02-21 16:50:15 +01:00
|
|
|
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
2024-04-21 13:07:00 +02:00
|
|
|
|
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
|
|
|
|
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
2024-04-20 15:53:19 +02:00
|
|
|
|
ynh_backup --src_path="/etc/logrotate.d/$app"
|
2024-04-21 12:43:18 +02:00
|
|
|
|
ynh_backup --src_path="/opt/couchdb/etc/local.d/05-flohmarkt.ini"
|
2024-05-06 07:47:13 +02:00
|
|
|
|
ynh_backup --src_path="/etc/systemd/system/$flohmarkt_filename.service"
|
2024-05-08 16:14:04 +02:00
|
|
|
|
ynh_backup --src_path="${flohmarkt_log_dir}"
|
2024-05-15 13:38:45 +02:00
|
|
|
|
ynh_backup --src_path="$flohmarkt_sym_install"
|
|
|
|
|
ynh_backup --src_path="$flohmarkt_sym_data_dir"
|
|
|
|
|
ynh_backup --src_path="$flohmarkt_sym_log_dir"
|
|
|
|
|
|
2024-02-21 16:50:15 +01:00
|
|
|
|
|
2024-04-20 15:53:19 +02:00
|
|
|
|
# for the following backups we'll want to stop flohmarkt and couchdb
|
|
|
|
|
# to guarentee a consistant state
|
2024-05-15 13:30:26 +02:00
|
|
|
|
ynh_print_info --message="Stopping flohmarkt to backup data..."
|
2024-05-14 14:13:41 +02:00
|
|
|
|
flohmarkt_ynh_stop_service
|
2024-02-21 16:50:15 +01:00
|
|
|
|
|
2024-04-25 10:43:20 +02:00
|
|
|
|
# https://codeberg.org/ChriChri/flohmarkt_ynh/issues/24
|
2024-04-22 17:32:13 +02:00
|
|
|
|
# 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:
|
2024-04-25 10:43:20 +02:00
|
|
|
|
# "don't want that your package does backup that part during ynh_backup_before_upgrade"
|
2024-04-22 17:32:13 +02:00
|
|
|
|
# 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
|
2024-05-06 07:47:13 +02:00
|
|
|
|
ynh_backup --src_path="$flohmarkt_data_dir"
|
2024-02-21 16:50:15 +01:00
|
|
|
|
|
2024-05-14 14:13:41 +02:00
|
|
|
|
ynh_print_info --message="Dumping couchdb..."
|
|
|
|
|
flohmarkt_ynh_dump_couchdb
|
|
|
|
|
|
|
|
|
|
ynh_print_info --message="Starting flohmarkt..."
|
2024-05-08 16:14:04 +02:00
|
|
|
|
flohmarkt_ynh_start_service
|
2024-02-21 16:50:15 +01:00
|
|
|
|
|
2024-05-14 14:13:41 +02:00
|
|
|
|
ynh_print_info --message="Backup script completed for $app."
|