userlogrotate: fix bug introduced in commit 2e54944a24
(rotated files were not zipped)
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
This commit is contained in:
parent
d9c5563fd6
commit
cc7c2a7d4e
|
@ -49,6 +49,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
|
|||
* postfix (packmail only): disable `concurrency_failed_cohort_limit` for destination smtp-amavis to prevent the suspension of this destination when Amavis fails to answer. Indeed, we configure the suspension delay quite long in `minimal_backoff_time` (2h) and `maximal_backoff_time` (6h) to reduce the risk of ban from external SMTPs.
|
||||
* php: install using sury repositories on bullseye
|
||||
* postfix: remove unused "aliases_scope=sub" from virtual_aliases.cf (it generated warnings)
|
||||
* userlogrotate: fix bug introduced in commit 2e54944a246 (rotated files were not zipped)
|
||||
|
||||
### Removed
|
||||
|
||||
|
|
|
@ -39,13 +39,13 @@ test -x /usr/sbin/nginx && invoke-rc.d nginx rotate >/dev/null 2>&1
|
|||
# Else, an error is raised (gzip file size changed while zipping)
|
||||
# and logs written during the zipping process might be lost.
|
||||
|
||||
for log in access.log access-*.log error.log; do
|
||||
for log in access.log*[!\.gz] access-*.log*[!\.gz] error.log*[!\.gz]; do
|
||||
for i in `ls -1 -d $HOMEPREFIX/*/log/$log 2>/dev/null | grep -v \.bak\.`; do
|
||||
gzip $i
|
||||
done
|
||||
done
|
||||
|
||||
for log in production.log delayed_job.log development.log test.log; do
|
||||
for log in production.log*[!\.gz] delayed_job.log*[!\.gz] development.log*[!\.gz] test.log*[!\.gz]; do
|
||||
for i in `ls -1 -d $HOMEPREFIX/*/www/{,current/}log/$log 2>/dev/null | grep -v \.bak\.`; do
|
||||
gzip $i
|
||||
done
|
||||
|
|
|
@ -5,7 +5,6 @@ HOMEPREFIX="/home"
|
|||
|
||||
rotate () {
|
||||
mv $1 $1.$DATE
|
||||
gzip $1.$DATE
|
||||
touch $1
|
||||
chown $2 $1
|
||||
chmod g+r $1
|
||||
|
@ -36,3 +35,21 @@ for log in production.log delayed_job.log development.log test.log; do
|
|||
done
|
||||
|
||||
apache2ctl restart > /dev/null
|
||||
|
||||
# Zipping is done after web server reload, so that the file descriptor is released.
|
||||
# Else, an error is raised (gzip file size changed while zipping)
|
||||
# and logs written during the zipping process might be lost.
|
||||
|
||||
for log in access.log*[!\.gz] access-*.log*[!\.gz] error.log*[!\.gz]; do
|
||||
for i in `ls -1 -d $HOMEPREFIX/*/log/$log 2>/dev/null | grep -v \.bak\.`; do
|
||||
gzip $i
|
||||
done
|
||||
done
|
||||
|
||||
for log in production.log*[!\.gz] delayed_job.log*[!\.gz] development.log*[!\.gz] test.log*[!\.gz]; do
|
||||
for i in `ls -1 -d $HOMEPREFIX/*/www/{,current/}log/$log 2>/dev/null | grep -v \.bak\.`; do
|
||||
gzip $i
|
||||
done
|
||||
done
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue