3 scripts: tally_pre.sh tally_rotation_post.sh tally_post.sh the tally_pre.sh is run before the whole works so you can run things ahead of the tally. Also returning a non-zero result will abort the tally. tally_rotation_post.sh will be called immediately after the rotation/truncation near the start of the tally. tally_post.sh is used if you need to do any custom cleanup. Return value doesn't change anything.