Skip to content

Instantly share code, notes, and snippets.

@fclairamb
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fclairamb/4802ea5c939d87e203d8 to your computer and use it in GitHub Desktop.
Save fclairamb/4802ea5c939d87e203d8 to your computer and use it in GitHub Desktop.
Cassandra: Number of sstable files
#!/bin/sh
# To put in /etc/cron.daily
date=$(date +%Y-%m-%d)
cd /var/lib/cassandra/data
for dir in $(find -mindepth 2 -maxdepth 2 -type d)
do
count=$(ls $dir/*-Data.db 2>/dev/null | wc -l)
echo ${date}: ${count} >>$dir/sstables_count
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment