Created
November 24, 2022 13:22
-
-
Save JanDeDobbeleer/e0c8e29295251fb0773b2c2cbad8ff8d to your computer and use it in GitHub Desktop.
Matodon 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/mastodon/live | |
bin/tootctl media remove --days=7 | |
bin/tootctl preview-cards remove --days=7 | |
bin/tootctl statuses remove --days=3 | |
bin/tootctl media remove-orphans |
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
SHELL=/bin/bash | |
PATH=/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/bin:/usr/local/bin:/usr/bin:/bin | |
### | |
### Mastodon cronjobs for media cache purging | |
### | |
RAILS_ENV=production | |
0 0 * * * /home/mastodon/scripts/cleanup.sh >> /home/mastodon/logs/cleanup-`date +\%F`.log 2>&1 | |
0 0 * * * /home/mastodon/scripts/logs.sh >> /home/mastodon/logs/logs-`date +\%F`.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 | |
find /home/mastodon/logs -type f -mtime +7 -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
equivalent cron job for my k8s setup:
Notea: