1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00

backup: add fail2ban log file in backup

and restore it
This commit is contained in:
Gwen Lg 2023-11-25 13:51:09 +01:00
parent 09e0b5101e
commit 644fb9df4b
2 changed files with 2 additions and 0 deletions

View file

@ -45,6 +45,7 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
# BACKUP FAIL2BAN CONFIGURATION
#=================================================
ynh_backup --src_path="/var/log/nginx/$domain-access.log"
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"

View file

@ -73,6 +73,7 @@ ynh_script_progression --message="Restoring fail2ban configuration..."
# If it doesn't exist, create the logfile, required before configuring fail2ban
log4fail2ban="/var/log/nginx/${domain}-access.log"
ynh_restore_file --origin_path="${log4fail2ban}"
if [ ! -f "${log4fail2ban}" ]; then
touch "${log4fail2ban}"
fi