mirror of
https://github.com/YunoHost-Apps/vikunja_ynh.git
synced 2024-09-03 18:06:26 +02:00
Add logrotate
This commit is contained in:
parent
6d073e997f
commit
fa7f39d9a7
3 changed files with 26 additions and 0 deletions
|
@ -40,6 +40,12 @@ ynh_backup --src_path="$final_path"
|
|||
ynh_backup --src_path="/etc/vikunja/config.yml"
|
||||
ynh_backup --src_path="/opt/vikunja"
|
||||
|
||||
#=================================================
|
||||
# BACKUP LOGROTATE
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
|
|
@ -138,6 +138,18 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
|||
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
# SETUP LOGROTATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring log rotation..." --time --weight=1
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
ynh_use_logrotate
|
||||
|
||||
mkdir -p /var/log/$app
|
||||
touch /var/log/$app/$app.log
|
||||
chown $app -R /var/log/$app
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
|
|
|
@ -96,6 +96,14 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig
|
|||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service --quiet
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||
chown $app -R /var/log/$app
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue