script to prune scratch dirs