The following bash scripts can be used to clean up the Mastodon caches to recover some space.
Last active
June 16, 2025 19:21
-
-
Save questionlp/6d1be7988528c3005c4daf9715318c4b to your computer and use it in GitHub Desktop.
Mastodon Cache Cleanup Scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd ${HOME}/live | |
PATH=${HOME}/bin:${HOME}/.local/bin:${HOME}/.rbenv/plugins/ruby-build/bin:${HOME}/.rbenv/shims:${HOME}/.rbenv/ | |
bin:/usr/bin:/bin | |
RAILS_ENV=production bin/tootctl media remove --days=3 > log/media_remove.log 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd ${HOME}/live | |
PATH=${HOME}/bin:${HOME}/.local/bin:${HOME}/.rbenv/plugins/ruby-build/bin:${HOME}/.rbenv/shims:${HOME}/.rbenv/ | |
bin:/usr/bin:/bin | |
RAILS_ENV=production bin/tootctl media remove-orphans > log/media_remove-orphans.log 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd ${HOME}/live | |
PATH=${HOME}/bin:${HOME}/.local/bin:${HOME}/.rbenv/plugins/ruby-build/bin:${HOME}/.rbenv/shims:${HOME}/.rbenv/ | |
bin:/usr/bin:/bin | |
RAILS_ENV=production bin/tootctl preview-cards remove --days=7 > log/preview-cards_remove.log 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
00 3 * * * ~/scripts/clean_media.sh | |
15 3 1 * * ~/scripts/clean_preview_cards.sh | |
30 3 * * 2 ~/scripts/clean_orphans.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment