mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 21:38:13 +00:00
Сleanup log files after image-generation on Ubuntu (#1395)
This commit is contained in:
committed by
GitHub
parent
f7a61d3d46
commit
6dde8b7b1c
@@ -8,6 +8,19 @@ before=$(df / -Pm | awk 'NR==2{print $4}')
|
||||
apt-get clean
|
||||
rm -rf /tmp/*
|
||||
|
||||
# journalctl
|
||||
if command -v journalctl; then
|
||||
journalctl --rotate
|
||||
journalctl --vacuum-time=1s
|
||||
fi
|
||||
|
||||
# delete all .gz and rotated file
|
||||
find /var/log -type f -regex ".*\.gz$" -delete
|
||||
find /var/log -type f -regex ".*\.[0-9]$" -delete
|
||||
|
||||
# wipe log files
|
||||
find /var/log/ -type f -exec cp /dev/null {} \;
|
||||
|
||||
# after cleanup
|
||||
after=$(df / -Pm | awk 'NR==2{print $4}')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user