Yes,For example , " druid.indexer.storage.recentlyFinishedThreshold=PT30M " adding with overlord runtime properties and it will remove the tasks from sys.tasks table , tasks which are older than 30 minutes as per my configured duration and you will not able to see those tasks in druid console. You can configure as suggested earlier druid.indexer.storage.recentlyFinishedThreshold=PT6H or PT4H . For cleaning tasks from(druid_tasks) metaDB its better to configure auto log kill setting for auto metadata cleanup than doing it manually.
Please see "druid.indexer.logs.kill.enabled" and related parameters in https://druid.apache.org/docs/latest/configuration/index.html#log-retention-policyhttps://docs.imply.io/2021.09/druid/operations/clean-metadata-store/#configure-automated-metadata-cleanup