#mastodon #cleanup @Gargron

my harddisk slowly fills up, especially

public/system/accounts
public/system/preview

must be lost of federated stuff. is there a way to cleanup these folers? its over 15GB actually and i would love to reduce it or hold it at some level. we do not need any federated old stuff nobody shared, fav, or otherwise used.

@kmj @Gargron I clean out previews using a simple find on the filesystem. Doesn't work so well for accounts data, since Mastodon doesn't automatically fetch missing avatars and header images for known accounts (though you can force an update using tootctl accounts refresh --all).

When using the local filesystem, media expiry tends to result in having tons of empty directories, and I regularly delete those too.

@kmj @Gargron So that's like two cronjobs:
@weekly cd /home/mastodon/live && find /home/mastodon/live/public/system/preview_cards -type f -atime +7 -delete
(watch out for "noatime" mounts)
@weekly cd /home/mastodon/live/public/system && find . -type d -empty -print0 | xargs -0 -n 1 rmdir

@galaxis @kmj @Gargron Thank you so much for sharing your maintenance procedures, especially on preview_cards folder and empty media folders. Your commands worked great and really helped reduce my server loads!

フォロー

@galaxis @kmj @Gargron I'm going to add them to my cron routines right away.

ログインして会話に参加
Mastodon at crazynewworld.net

Mastodon は、オープンなウェブプロトコルを採用した、自由でオープンソースなソーシャルネットワークです。電子メールのような分散型の仕組みを採っています。