mirror of
https://github.com/YunoHost-Apps/weblate_ynh.git
synced 2024-10-01 13:35:04 +02:00
add logrotate
This commit is contained in:
parent
5df42eb737
commit
6872223e5a
7 changed files with 39 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
# dependencies used by the app
|
||||
pkg_dependencies="libxml2-dev libxslt-dev libfreetype6-dev \
|
||||
libjpeg-dev libz-dev libyaml-dev python3-dev python3-pip python3-virtualenv \
|
||||
python3-enchant \
|
||||
postgresql libpq-dev uwsgi uwsgi-plugin-python3 \
|
||||
libpango1.0-dev libcairo2-dev libglib2.0-dev libgirepository1.0-dev \
|
||||
mailutils python-celery-common virtualenv redis-server"
|
||||
|
|
|
@ -61,6 +61,13 @@ ynh_backup "db.sql"
|
|||
|
||||
#=================================================
|
||||
# SPECIFIC BACKUP
|
||||
#=================================================
|
||||
# BACKUP LOGROTATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up logrotate configuration..." --time --weight=1
|
||||
|
||||
ynh_backup --src_path="/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE CRON FILE
|
||||
#=================================================
|
||||
|
|
|
@ -300,6 +300,14 @@ chown -R "$app": "$final_path/data"
|
|||
mkdir -p "$final_path/avatar-cache"
|
||||
chown -R "$app": "$final_path/avatar-cache"
|
||||
|
||||
#=================================================
|
||||
# SETUP LOGROTATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring log rotation..." --time --weight=1
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
ynh_use_logrotate --logfile "/var/log/$app-celery"
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
|
|
|
@ -79,6 +79,14 @@ ynh_script_progression --message="Removing nginx web server configuration..." --
|
|||
# Remove the dedicated nginx config
|
||||
ynh_remove_nginx_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1
|
||||
|
||||
# Remove the app-specific logrotate config
|
||||
ynh_remove_logrotate
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC REMOVE
|
||||
#=================================================
|
||||
|
|
|
@ -123,6 +123,12 @@ ynh_restore_file "/etc/cron.d/$app"
|
|||
ynh_script_progression --message="Restore hub's binary file..." --time --weight=1
|
||||
ynh_restore_file "/usr/bin/hub"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
|
|
@ -397,6 +397,14 @@ cp ../conf/cron "/etc/cron.d/$app"
|
|||
ynh_replace_string "__APP__" "$app" "/etc/cron.d/$app"
|
||||
ynh_replace_string "__FINALPATH__" "$final_path/" "/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# SETUP LOGROTATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading logrotate configuration..." --time --weight=1
|
||||
|
||||
# Use logrotate to manage app-specific logfile(s)
|
||||
ynh_use_logrotate --logfile "/var/log/$app-celery" --non-append
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue