#!/bin/bash # DO NOT MODIFY # This file is maintained in dsa-puppet ( if ! flock -x -n 200 ; then exit; fi if [ "$1" = "-v" ]; then verbose="-v" else verbose="" fi cpus=$(cat /proc/cpuinfo | grep '^processor[[:space:]]' | wc -l) find /var/log/hosts -type f ! -name '*.gz' -a ! -name '*.xz' -mtime +2 -print0 | xargs --no-run-if-empty -0 -n 4 -P "$cpus" xz $verbose find /var/log/hosts -type f -mtime +50 -print0 | xargs --no-run-if-empty -0 rm $verbose find /var/log/hosts -type d -mtime +2 -empty -print0 | xargs --no-run-if-empty -0 rmdir $verbose ) 200< /var/log/hosts