Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete Chat History in all rooms after x days #11122

Closed
eszeus opened this issue Jun 13, 2018 · 8 comments
Closed

Delete Chat History in all rooms after x days #11122

eszeus opened this issue Jun 13, 2018 · 8 comments

Comments

@eszeus
Copy link

eszeus commented Jun 13, 2018

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.

@vynmera
Copy link
Contributor

vynmera commented Jun 13, 2018

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

@eszeus
Copy link
Author

eszeus commented Jun 13, 2018

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

@vynmera
Copy link
Contributor

vynmera commented Jun 13, 2018

@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.

@eszeus
Copy link
Author

eszeus commented Jun 13, 2018

@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 ;)

@antgel
Copy link
Contributor

antgel commented Jun 13, 2018

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

@antgel antgel closed this as completed Jun 13, 2018
@eszeus
Copy link
Author

eszeus commented Jun 13, 2018

@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.

@antgel
Copy link
Contributor

antgel commented Jun 13, 2018

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.

@kaiiiiiiiii
Copy link
Contributor

kaiiiiiiiii commented Jun 13, 2018

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants