!/bin/bashget_latest_snapshot=$(nodetoollistsnapshots|awk'{print $1}'|grepopscenter|sort|tail-1)get_older_snapshot=$(nodetoollistsnapshots|awk'{print $1}'|grepopscenter|sort|head-1)if [ "${get_latest_snapshot}"!="${get_older_snapshot}" ]; thenecho"Strings are not equal. Clearing old snapshot"# nodetool clearsnapshot -t ${get_older_snapshot}echo"Done"elseecho"Strings are equal. There is only the latest snapshot left"fi