Add /dev/sdc PV at manda
[mirror/dsa-puppet.git] / modules / syslog_ng / files / loggers-cron
1 #!/bin/bash
2
3 # DO NOT MODIFY
4 # This file is maintained in dsa-puppet
5
6 (
7   if ! flock -x -n 200 ; then exit; fi
8
9   if [ "$1" = "-v" ]; then
10     verbose="-v"
11   else
12     verbose=""
13   fi
14   cpus=$(cat /proc/cpuinfo | grep '^processor[[:space:]]' | wc -l)
15
16   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
17   find /var/log/hosts -type f -mtime +50 -print0 | xargs --no-run-if-empty -0 rm $verbose
18   find /var/log/hosts -type d -mtime +2 -empty -print0 | xargs --no-run-if-empty -0 rmdir $verbose
19 ) 200< /var/log/hosts