From 23761c310273288d1dd2151d3aa468e31cca7965 Mon Sep 17 00:00:00 2001 From: "Pedro hates github.com" <39959198+pedro-nonfree@users.noreply.github.com> Date: Wed, 15 Apr 2020 15:11:36 +0200 Subject: [PATCH] warnings on purge local media --- Synapse-database-maintenance-tools.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Synapse-database-maintenance-tools.md b/Synapse-database-maintenance-tools.md index e44f905..7e84f29 100644 --- a/Synapse-database-maintenance-tools.md +++ b/Synapse-database-maintenance-tools.md @@ -4,11 +4,15 @@ List of useful tools and scripts for maintenance Synapse database: The purge remote media API allows server admins to purge old cached remote media. #### Purge local media -There is no purge API for local media because you may be the only one with a copy. If you are sure you want to delete local media you could use something like the following to delete media that hasn't been accessed in a while. + +There is no purge API for local media because you may be the only one with a copy. If you are sure you want to delete local media you could use something like the following to delete media that hasn't been accessed in a while. **Warning 1, check noatime flag**: You also have to double-check that the filesystem where synapse's media store don't have [noatime flag](https://unix.stackexchange.com/questions/219015/how-to-disable-access-time-settings-in-debian-linux/219017#219017). Check it with `mount`, `noatime` is something that is usually enabled by default to reduce read-write operations in the filesystem for a feature is not so demanded. **Warning 2, what contents**, the next command applies to `local_content local_thumbnails remote_content remote_thumbnail` (that are the subdirectories of media directory), remote content should use [Purge History API](https://github.com/matrix-org/synapse/blob/master/docs/admin_api/purge_history_api.rst), and maybe you want to delete just the `local_content` ? `find /path/to/synapse/media_store -atime +365 -delete` + This will delete media that hasn't been accessed in 365 days. +*I think this section is missing some coherence with the database structure* + ## [Purge History API](https://github.com/matrix-org/synapse/blob/master/docs/admin_api/purge_history_api.rst) The purge history API allows server admins to purge historic events from their database, reclaiming disk space.