Skip to content

Instantly share code, notes, and snippets.

@leehosung
leehosung / clearup_rrds.sh
Created July 11, 2014 01:41
remove ganglia empty rrd file daily
#!/bin/bash
#0 16 * * * /bin/bash /home/ubuntu/cleanup_rrds.sh
pushd /var/lib/ganglia/rrds/CLUSTER/
DLST=( `du -h | grep 4.0K | awk '{print $2}' ` )
echo "CLEANUP DIRS: ${#DLST}"
[ ${#DLST} -gt 0 ] && ( echo $DLST | xargs sudo rm -rf && echo "Done")
popd