https://github.com/bazzline/mattermost_housekeeping
Free as in freedom mattermost housekeeping script to delete data older than x days from your local sever
https://github.com/bazzline/mattermost_housekeeping
cleanu cronjob fileinfo housekeeping mattermost mysql posts retention systemd
Last synced: about 2 months ago
JSON representation
Free as in freedom mattermost housekeeping script to delete data older than x days from your local sever
- Host: GitHub
- URL: https://github.com/bazzline/mattermost_housekeeping
- Owner: bazzline
- License: gpl-3.0
- Created: 2021-05-20T08:19:42.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-13T13:53:01.000Z (over 1 year ago)
- Last Synced: 2025-03-27T23:41:55.749Z (2 months ago)
- Topics: cleanu, cronjob, fileinfo, housekeeping, mattermost, mysql, posts, retention, systemd
- Language: Shell
- Homepage:
- Size: 77.1 KB
- Stars: 8
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Mattermost housekeeping script
Deletes old entries in Post and FileInfo on MatterMost GPLv2.
## General
Free as in freedom mattermost housekeeping script.
The current change log can be found [here](CHANGELOG.md).
The current documentation can be found [here](documentation).
This script supports MySQL/MariaDB only right now. If you need something for postgresql, take a look to [mattermost-retention](https://github.com/aljazceru/mattermost-retention).
## Setup
Please read the [installation](documentation/setup/install.md) docmentation.
The script comes with an [install](bin/install.sh)- and an [uninstall](bin/uninstall.sh) routine.
All configurable values are configured in `/data/local_configuration.sh`.
## What
This is a full blown cronjob/systemd.service to cleanup the mattermost database tables `Posts` and `FileInfo`.
Entries older than x days where removed. This includes the attachments on the disk.
## Why
I am using my private mattermost server to communicate with each other.
A german saying is "was interessiert mich mein geschwätz von Gestern" ("what do I care about my chatter from yesterday"). Also a german word called "Datenhygiene" ("data hygiene") is important. Plus, as the administrator, I want to keep the system fast for daily use.
Because of that, I wanted an easy way to remove messages older than x days. There is no official configuration section in the open source version of mattermost, so I've written this little script.The script removes entries older than `` days from the database tables `Posts` and `FileInfo`.
The script also removes the deleted files from the filesystem.Right now, only mysql is supported.
Right now, you have to duplicate the configuration values from your `/usr/share/webapps/mattermost/config/config.json`. Since the configuration is written in json and json is !fun in bash, we have to keep it that way.Thanks to [matterclean](https://github.com/sinfallas/matterclean/blob/master/matterclean) and [rsyslog_mysql_housekeeping](https://github.com/bazzline/rsyslog_mysql_housekeeping).