Backup and restore the log directory

This commit is contained in:
Félix Piédallu 2023-11-05 23:09:46 +01:00
parent 0a732cbcc4
commit 1b9796fb2b
2 changed files with 14 additions and 0 deletions

View file

@ -62,6 +62,10 @@ ynh_backup --src_path="/etc/cron.d/$app"
ynh_backup --src_path="/etc/$app/"
# For apps with huge logs, you might want to pass --is_big,
# and in restore script, mkdir and pass --not_mandatory to ynh_restore_file.
ynh_backup --src_path="/var/log/$app/"
#=================================================
# BACKUP THE MYSQL DATABASE
#=================================================

View file

@ -61,6 +61,16 @@ ynh_systemd_action --action=restart --service_name=fail2ban
ynh_restore_file --origin_path="/etc/cron.d/$app"
ynh_restore_file --origin_path="/etc/$app/"
# For apps with huge logs, you might want to not backup logs every time:
# The mkdir call is just here in case the log directory was not backed up.
# mkdir -p "/var/log/$app"
# chown $app:www-data "/var/log/$app"
# ynh_restore_file --src_path="/var/log/$app/" --not_mandatory
#
# For other apps, the simple way is better:
ynh_restore_file --origin_path="/var/log/$app/"
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================