1
0
Fork 0
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:
ericgaspar 2022-01-16 15:49:38 +01:00
parent 6d073e997f
commit fa7f39d9a7
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 26 additions and 0 deletions

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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
#=================================================