2012 February 10

Squid clean logs

#!/bin/bash
find /var/log/squid3/ -type f -name cache.log* -mtime +7 -exec rm -rf {} \;
find /var/log/squid3/ -maxdepth 1 -type f -name access.log* -mtime +7 -exec mv {} /var/log/squid3/log_archive/ \;
find /var/log/squid3/log_archive -type f -mtime +365 -exec rm -rf {} \;

By WladyX on 10 February, 2012 | Uncategorized | A comment?

Find non recursive

-maxdepth 1

By WladyX on | Uncategorized | A comment?