Schedule weekly database auto cleanup¶
To set up automatic database cleanup, we use the embedded Linus tool - crontab.
To do that, run the following command:
sudo crontab -e
Input the following text in the new line:
0 1 * * 7 sudo staffcop cleanup 100 >> /srv/cleanupdb.log
Each Sunday at 1 AM (server local time) all the events older than 100 days will be erased and the operation log will be added to file “/srv/cleanupdb.log