Article 5E24P I am trying to make a script to first check and empty those file in /var/log/ which are greater than 500MB

I am trying to make a script to first check and empty those file in /var/log/ which are greater than 500MB

by
karan2119
from LinuxQuestions.org on (#5E24P)
#!/bin/bash
log_dir=`ls -laSh /var/log/`

for entry in $log_dir
do
Max=$(`stat -f %s "$log_dir"`)
if [[ "$Max" -ge 5000000000 ]]
then
echo "file is over $entry"
#echo /dev/null > $log_dir
else
echo "$entry, File is fine "$Max""
fi
donelatest?d=yIl2AUoC8zA latest?i=F5ZrdBHJKhc:A5qDA5RCjDw:F7zBnMy latest?i=F5ZrdBHJKhc:A5qDA5RCjDw:V_sGLiP latest?d=qj6IDK7rITs latest?i=F5ZrdBHJKhc:A5qDA5RCjDw:gIN9vFwF5ZrdBHJKhc
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments