Don't delete remote media manually

Aaron Raimist 2020-06-19 10:51:18 -05:00
parent 7a9cff60e6
commit e478f2dd11
1 changed files with 4 additions and 7 deletions

@ -5,17 +5,14 @@ The purge remote media API allows server admins to purge old cached remote media
#### Purge local 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. `find /path/to/synapse/media_store/local_content -atime +365 -delete`
`find /path/to/synapse/media_store/local_thumbnails -atime +365 -delete`
**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. This will delete media that hasn't been accessed in 365 days.
*I think this section is missing some coherence with the database structure* **Warning, 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.
## [Purge History API](https://github.com/matrix-org/synapse/blob/master/docs/admin_api/purge_history_api.rst) ## [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. The purge history API allows server admins to purge historic events from their database, reclaiming disk space.