Add mastodon cleanup script
This commit is contained in:
parent
f063b09540
commit
5017b3ad78
2 changed files with 28 additions and 0 deletions
10
ansible/roles/mastodon/files/purge-media.sh
Normal file
10
ansible/roles/mastodon/files/purge-media.sh
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
cd /opt/mastodon
|
||||||
|
|
||||||
|
docker-compose exec mastodon tootctl media remove --days=7
|
||||||
|
docker-compose exec mastodon tootctl statuses remove --days=7
|
||||||
|
docker-compose exec mastodon tootctl preview_cards remove --days=7
|
||||||
|
docker-compose exec mastodon tootctl cache clear
|
|
@ -18,3 +18,21 @@
|
||||||
validate: docker-compose -f %s config
|
validate: docker-compose -f %s config
|
||||||
notify: restart mastodon
|
notify: restart mastodon
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
- name: Install media cleanup script
|
||||||
|
template:
|
||||||
|
src: files/purge-media.sh
|
||||||
|
dest: /opt/mastodon/purge-media.sh
|
||||||
|
mode: "0755"
|
||||||
|
owner: "{{ docker_user.name }}"
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Schedule media cleanup
|
||||||
|
cron:
|
||||||
|
name: clean up mastodon media
|
||||||
|
hour: 2
|
||||||
|
minute: 0
|
||||||
|
weekday: 1
|
||||||
|
job: /opt/mastodon/purge-media.sh
|
||||||
|
user: "{{ docker_user.name }}"
|
||||||
|
become: true
|
||||||
|
|
Loading…
Reference in a new issue