Hello All,
As background, we have been experiencing low disk space on our Cassandra server. As a temporary measure, we need to remove Cassandra Reaper log files located on the SDA2 disk.
Therefore, I would like to ask if anyone has experience or knowledge on how to implement a CronJob on the Cassandra server. The goal is to automate the removal of the largest log files in the Cassandra Reaper folder whenever disk usage reaches 80% or higher.
I am currently performing this cleanup manually, which is quite time-consuming. Automating this process using a CronJob would greatly improve efficiency.
If this is feasible, I would appreciate a detailed guideline on how to set it up.
Looking forward to your thoughts and suggestions on this matter.
Since Reaper is the big culprit here, I will suggest first you reduce its logging or turn it off completely.
Setting up a cronjob is well documented. Here is how its done in Ubuntu for example.
Your cronjob needs to call a script that handles the clean-up. In your script you can implement the logic you stated e.g. check disk usage then delete file. In the past when I did something similar I took a different approach, I had my cronjob running everyday and deleting log files older than x number of days. Just highlighting here the flexibility that is possible.
Hope this helps.