Rocket.chat: Delete Chat History in all rooms after x days

Created on 13 Jun 2018  路  8Comments  路  Source: RocketChat/Rocket.Chat

Hello,

I already searched and read all the topics about other users who encountered the same problem, and wants the same thing: Delete the chat history of all public and private rooms after x days.

I tried it with a cronjob script, but the script isnt working for me, sadly.

Is there anybody who could help me out on this? ;)
Using this script right now, but jq is giving me an error.
rocketchat_delete_old_messages.txt
"jq: error (at :0): Cannot iterate over null (null)"

Any help would be really awesome.
We are using this in the office, and we have strict policies about the written and logged things.
It needs to be deleted very often.

All 8 comments

You can use rooms.cleanHistory, as a REST API call.

@vynmera How do I do this? Sorry for asking :D

@eszeus Have a look here: https://rocket.chat/docs/developer-guides/rest-api/rooms/cleanhistory/

Basically, send a POST request to (your server)/api/v1/rooms.cleanHistory, with content:

{
    "roomId": "your channel ID",
    "latest": "timestamp of latest to remove",
    "oldest": "timestamp of oldest to remove"
}

You can automate this for all channels, just set latest to X days ago, and oldest to something really long ago (e.g. 1970), and loop through your channels with it.

@vynmera is there a way to make this automatically and in general for all channels? without doing this for each channel.

Sry for all my questions ;)

Please take this offline, perhaps to one of the various RC support channels / forums. GitHub Issues are for reporting bugs and feature requests.

@antgel isnt this a feature request, too`?
As much as I saw, way too many people requested this feature to be implemented.
So to help people out who are searching the same issue, its not bad to have proper explanation about how we can achieve this.

Closing this instantly is kind of censorship, specially if no link/url is provided where this should continue...

Well, thanks antgel.

Looks like a support request to me ("Is there anybody who could help me out on this? ;)"). Feel free to open a Feature Request using the template.

The project has 1811 open Issues which is extremely difficult to manage, hence the triaging.

@eszeus There're already a bunch of requests related to this feature. Please don't open a new one :)

2355, #3528, #7151, #7011, #8321, ...

So to help people out who are searching the same issue, its not bad to have proper explanation about how we can achieve this.

2355 has a hell load of informations how to archive this functionality as long as there's no CORE feature.

Was this page helpful?
0 / 5 - 0 ratings