Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

delete old data to clean up database #890

Open
rubo77 opened this issue Jun 21, 2016 · 6 comments
Open

delete old data to clean up database #890

rubo77 opened this issue Jun 21, 2016 · 6 comments
Labels
A-Disk-Space things which fill up the disk z-feature (Deprecated Label)

Comments

@rubo77
Copy link
Contributor

rubo77 commented Jun 21, 2016

add a config value to set a timout for all data in the homeserver.

If you want to run a server with ephemeral data, there should be an option that everything is deleted e.g. after 7 days.

  • users that didn't log in should be deleted
  • history deleted
  • invites, etc.
@rubo77
Copy link
Contributor Author

rubo77 commented Aug 21, 2016

You could add a cronjob, that calls the script suggested in #1034 regularly on all rooms

@fuzzy76
Copy link

fuzzy76 commented Oct 7, 2016

Would be interesting if someone could make a script that find all rooms automatically first.

@rubo77
Copy link
Contributor Author

rubo77 commented Oct 8, 2016

You find all rooms with simply

sqlite3 homeserver.db "pragma busy_timeout=20000; SELECT room_id FROM rooms"

If you look for the names use

sqlite3 --header homeserver.db "pragma busy_timeout=20000; SELECT n.name, r.room_id FROM rooms r, room_names n WHERE n.room_id=r.room_id limit 1"

@rubo77
Copy link
Contributor Author

rubo77 commented Nov 18, 2016

If you want to call it via a script you can use the script from my PR here: #1034

@rubo77
Copy link
Contributor Author

rubo77 commented Dec 31, 2016

A start would be to "Redact all events older than a certain time" #1730

@rubo77
Copy link
Contributor Author

rubo77 commented Aug 10, 2018

This tool also calls the purge API in a configurable task: https://github.com/aperezdc/synpurge

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Disk-Space things which fill up the disk z-feature (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

3 participants