Merge pull request #217 from Salamandar/backuplog

Backup and restore the log directory
This commit is contained in:
eric_G 2024-01-10 23:15:29 +01:00 committed by GitHub
commit 021125aa33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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/" 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 # BACKUP THE MYSQL DATABASE
#================================================= #=================================================

View file

@ -68,6 +68,16 @@ ynh_systemd_action --action=restart --service_name=fail2ban
ynh_restore_file --origin_path="/etc/cron.d/$app" ynh_restore_file --origin_path="/etc/cron.d/$app"
ynh_restore_file --origin_path="/etc/$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 # RESTORE THE MYSQL DATABASE
#================================================= #=================================================