Media¶
synadm media¶
Manage local and remote media
synadm media [OPTIONS] COMMAND [ARGS]...
delete¶
delete media by ID, size or age
synadm media delete [OPTIONS]
Options
-
-i
,
--media-id
<media_id>
¶ the media with this specific media ID will be deleted.
-
-d
,
--before-days
<before_days>
¶ delete all media that was last accessed before this number of days ago.
-
-b
,
--before
<before>
¶ delete all media that was last accessed before this date/time. Eg. ‘2021-01-01’, see above for available date/time formats.
-
-t
,
--before-ts
<before_ts>
¶ delete all media that was last accessed before this unix timestamp in ms.
-
--size
,
--kib
<size>
¶ delete all media that is larger than this size in KiB (1 KiB = 1024 bytes).
-
--delete-profiles
,
--all
¶
also delete files that are still used in image data (e.g user profile, room avatar). If set, these files will be deleted too. Not valid when a specific media is being deleted (–media-id)
list¶
list local media by room or user
synadm media list [OPTIONS]
Options
-
-r
,
--room-id
<room_id>
¶ list all media in room with this room ID (‘!abcdefg’).
-
-u
,
--user-id
<user_id>
¶ list all media uploaded by user with this matrix ID (@user:server).
-
-f
,
--from
<from_>
¶ offset media listing by given number. This option is also used for pagination but only supported together with –user-id.
- Default
0
-
-l
,
--limit
<limit>
¶ limit media listing to given number. This option is only supported together with –user-id.
- Default
100
-
-s
,
--sort
<sort>
¶ The method by which to sort the returned list of media. If the ordered field has duplicates, the second order is always by ascending media_id, which guarantees a stable ordering. This option is only supported together with –user-id.
- Options
media_id | upload_name | created_ts | last_access_ts | media_length | media_type | quarantined_by | safe_from_quarantine
-
-R
,
--reverse
¶
Direction of media order. If set it will reverse the sort order of –order-by method. This option is only supported together with –user-id.
protect¶
protect specific media from being quarantined
synadm media protect [OPTIONS] MEDIA_ID
Arguments
-
MEDIA_ID
¶
Required argument
purge¶
Purge old cached remote media
synadm media purge [OPTIONS]
Options
-
-d
,
--before-days
<before_days>
¶ Purge all media that was last accessed before this number of days ago.
-
-b
,
--before
<before>
¶ Purge all media that was last accessed before this date/time. Eg. ‘2021-01-01’, see above for available date/time formats.
-
-t
,
--before-ts
<before_ts>
¶ Purge all media that was last accessed before this unix timestamp in ms.
quarantine¶
quarantine media in rooms, by users or by media ID
synadm media quarantine [OPTIONS]
Options
-
-i
,
--media-id
<media_id>
¶ the media with this specific media ID will be quarantined.
-
-r
,
--room-id
<room_id>
¶ all media in room with this room ID (!abcdefg) will be quarantined.
-
-u
,
--user-id
<user_id>
¶ all media uploaded by user with this matrix ID (@user:server) will be quarantined.
-
-s
,
--server-name
<server_name>
¶ the server name of the media, mandatory when –media-id is used and _remote_ media should be processed. For locally stored media this option can be omitted.