The attached bash script, by default, keeps the last 28 (this can be modified) server.log.yyyy-mm-dd files from the jboss log folder. The rest are deleted. The aim is for this script to be scheduled to run once per day using cron.
For context see the windows batch file version which does the same thing:
https://communities.ca.com/docs/DOC-231163086