Add cached media cleanup cron job

This commit is contained in:
Johannes Zellner 2020-08-16 10:30:44 +02:00
parent 343889821f
commit 34fb84e4ef
3 changed files with 16 additions and 2 deletions

View file

@ -14,7 +14,13 @@
"postgresql": {},
"redis": {},
"sendmail": {},
"ldap": {}
"ldap": {},
"scheduler": {
"cleanup": {
"schedule": "11 11 * * *",
"command": "/app/pkg/cleanup.sh"
}
}
},
"minBoxVersion": "4.1.4",
"manifestVersion": 2,

View file

@ -41,7 +41,7 @@ RUN ln -fs /run/mastodon/bullet.log /app/code/log/bullet.log
RUN ln -fs /app/data/system /app/code/public/system
RUN rm -rf /app/code/tmp && ln -fs /tmp/mastodon /app/code/tmp
COPY start.sh env.template /app/pkg/
COPY start.sh cleanup.sh env.template /app/pkg/
CMD [ "/app/pkg/start.sh" ]

8
cleanup.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
set -eu
echo "=> Cleanup cached media"
cd /app/code
./bin/tootctl media remove