2023.01.11 Mastodon メディア削除

Mastodonは結構、メディア(画像と動画)でディスク容量を利用して、ディスクが小さいと時々削除してあげないとキャッシュでディスクフルになってしまいます。

root@mastdon:/app/mastodon# docker-compose run web bundle exec bin/tootctl media usage
[+] Running 2/0
 ⠿ Container mastodon-redis-1  Running                                                                                           0.0s
 ⠿ Container mastodon-db-1     Running                                                                                           0.0s
Attachments:	5.56 GB (131 KB local)
Custom emoji:	95.4 MB (0 Bytes local)
Preview cards:	265 MB
Avatars:	551 MB (0 Bytes local)
Headers:	1.17 GB (0 Bytes local)
Backups:	0 Bytes
Imports:	0 Bytes
Settings:	0 Bytes

7日以前のメディア(画像と動画)削除

root@mastdon:/app/mastodon# docker-compose run web bundle exec bin/tootctl media remove -d 7
[+] Running 2/0
 ⠿ Container mastodon-redis-1  Running                                                                                           0.0s
 ⠿ Container mastodon-db-1     Running                                                                                           0.0s
7255/7255 |===========================================================================================================| Time: 00:01:12
Removed 7255 media attachments (approx. 4.79 GB)


root@mastdon:/app/mastodon# docker-compose run web bundle exec bin/tootctl media usage
[+] Running 2/0
 ⠿ Container mastodon-db-1     Running                                                                                           0.0s
 ⠿ Container mastodon-redis-1  Running                                                                                           0.0s
Attachments:	792 MB (131 KB local)
Custom emoji:	95.4 MB (0 Bytes local)
Preview cards:	265 MB
Avatars:	551 MB (0 Bytes local)
Headers:	1.17 GB (0 Bytes local)
Backups:	0 Bytes
Imports:	0 Bytes
Settings:	0 Bytes