Is there a suggested way to automate the tasks cleanup?
I had thought maybe by using the cleanup section it would automatically run task cleanup, but it seems I have to run it manually each time. I know I can simply setup a cronjob, but is there a different method that is more recommended?
On our foreman/katello server there is a file /etc/cron.d/foreman-tasks which has been generated by foreman-installer. It runs the clean up every day:
SHELL=/bin/sh
RAILS_ENV=production
FOREMAN_HOME=/usr/share/foreman
TASK_BACKUP=false
# Clean up expired tasks from the database
45 19 * * * foreman /usr/sbin/foreman-rake foreman_tasks:cleanup >>/var/log/foreman/cron.log 2>&1
Thus if it is not working for you I’d rather wonder why it’s missing. You should check the current state of the foreman-plugin-tasks-automatic-cleanup installer option.