Remove Old Logs from Linux

Example

Remove logs older than 5 days

# find /var/log* -mtime +5 -exec rm {} \;
rm: cannot remove `/var/log/tomcat6': Is a directory
rm: cannot remove `/var/log/proftpd': Is a directory
rm: cannot remove `/var/log/clamav': Is a directory
rm: cannot remove `/var/log/prelink': Is a directory
rm: cannot remove `/var/log/sssd': Is a directory
rm: cannot remove `/var/log/roundcubemail': Is a directory
rm: cannot remove `/var/log/samba': Is a directory
rm: cannot remove `/var/log/samba/old': Is a directory
rm: cannot remove `/var/log/ConsoleKit': Is a directory
rm: cannot remove `/var/log/ntpstats': Is a directory
rm: cannot remove `/var/log/mailman': Is a directory
rm: cannot remove `/var/log/cups': Is a directory
rm: cannot remove `/var/log/audit': Is a directory

Leave a Comment