mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-18 15:56:47 +00:00
add cleanup-logs.sh post-generation script (#2138)
This commit is contained in:
committed by
GitHub
parent
b170f4b6c6
commit
3100bc2e63
14
images/linux/post-generation/cleanup-logs.sh
Normal file
14
images/linux/post-generation/cleanup-logs.sh
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 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 {} \;
|
||||||
Reference in New Issue
Block a user