Last active
March 4, 2022 14:24
-
-
Save kugelblitzz/dc34e51e5b341aa8e2c3e9fde7b024d3 to your computer and use it in GitHub Desktop.
This file contains 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 | |
journalPath=$(/usr/bin/find /var/log/ -name system.journal | /bin/sed 's:[^/]*$::') | |
rmCommandParam=$journalPath*@* | |
count=$(/bin/ls -l $journalPath | /usr/bin/wc -l) | |
#echo $count | |
#Only runs if more than 2 files are there | |
if [[ $count -gt 3 ]] | |
then | |
/bin/rm $rmCommandParam | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment