Last active
May 16, 2020 15:44
-
-
Save ET-CS/3242cab1cd4f1271df91 to your computer and use it in GitHub Desktop.
Linux (CentOS) clear log script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# this script clear logs in Linux (made in CentOS) | |
cd /var/log | |
truncate -s 0 /var/log/*log | |
find . -name "*.gz" -type f -delete | |
find . -name "*.0" -type f -delete | |
find . -name "*.1" -type f -delete | |
find . -name "*.log.*" -type f -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment