1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00

Move logs in /var/log

This commit is contained in:
yalh76 2022-10-03 00:00:06 +02:00
parent 1a1a34bd3c
commit 5e8a2104ab
6 changed files with 41 additions and 2 deletions

View file

@ -1,2 +1,2 @@
MAILTO="root"
*/10 * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/app/actualize_script.php >/var/www/__APP__/__APP__.log 2>&1
*/10 * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/app/actualize_script.php >/var/log/__APP__/__APP__.log 2>&1

View file

@ -57,6 +57,12 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP VARIOUS FILES
#=================================================

View file

@ -140,6 +140,15 @@ chmod 644 "/etc/cron.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1
mkdir -p "/var/log/$app"
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
#=================================================
# SETUP SSOWAT
#=================================================

View file

@ -73,6 +73,9 @@ ynh_script_progression --message="Removing various files..." --weight=1
# Remove a cron file
ynh_secure_remove --file="/etc/cron.d/$app"
# Remove the log files
ynh_secure_remove --file="/var/log/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -103,6 +103,14 @@ ynh_script_progression --message="Restoring various files..." --weight=1
ynh_restore_file --origin_path="/etc/cron.d/$app"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
mkdir -p "/var/log/$app"
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -153,11 +153,24 @@ chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
if [ -f /tmp/FreshRSS.log ]; then
ynh_secure_remove /tmp/FreshRSS.log
ynh_secure_remove --file="/tmp/FreshRSS.log"
fi
if [ -f /var/www/$app/$app.log ]; then
ynh_secure_remove --file="/var/www/$app/$app.log"
fi
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
mkdir -p "/var/log/$app"
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#=================================================
# RELOAD NGINX
#=================================================