Use truncate --no-create --size=0 to truncate files
This avoids the permission error due to /proc/sys/fs/protected_regular = 2 setting which is now enabled by default in bullseye.
This commit is contained in:
parent
d2bc6e278d
commit
c3968cf1c6
|
@ -5,5 +5,5 @@ set -e
|
|||
# Truncate log files
|
||||
for _FILE in $(find /var/log/ -type f)
|
||||
do
|
||||
: > ${_FILE}
|
||||
truncate --no-create --size=0 ${_FILE}
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue