The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
conditional deletion of log files
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
conditional deletion of log files
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
10-02-2007
fpmurphy
Moderator
Join Date: Dec 2003
Location: Florida
Posts: 1,945
You can use the -s option of the test(1) utility to determine
if the log file size is greater than zero i.e.
if test -s $LOGFILE
then
save $LOGFILE
else
rm -f $LOGFILE
if;
fpmurphy
View Public Profile
Visit fpmurphy's homepage!
Find all posts by fpmurphy
Find fpmurphy's past nominations received
Find fpmurphy's present nominations given