#mastodon #cleanup @Gargron

my harddisk slowly fills up, especially


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.

Sign in to participate in the conversation
Mastodon at crazynewworld.net

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!