Create easy way to do cronjobs for routine jobs #1

Open
opened 2021-05-15 19:49:06 +00:00 by roxxers · 3 comments

Required for cache and media clearing on instances that use local stoorage unless you want your whole harddive filled with cat videos from months ago

Required for cache and media clearing on instances that use local stoorage unless you want your whole harddive filled with cat videos from months ago
Owner

Probably the handiest thing is https://git.coopcloud.tech/coop-cloud/swarm-cronjob. We could have a compose.cron.yml which runs standard, useful jobs. These could be configurable by env vars? Unsure. There could be further compose.$job.yml to swap them in/out if required. Example in

compose.yml Lines 130 to 131 in 949f952ae4
- "swarm.cronjob.enable=true"
- "swarm.cronjob.schedule=0 * * * *"
you need to have https://git.coopcloud.tech/coop-cloud/swarm-cronjob running on the swarm first

Probably the handiest thing is https://git.coopcloud.tech/coop-cloud/swarm-cronjob. We could have a `compose.cron.yml` which runs standard, useful jobs. These could be configurable by env vars? Unsure. There could be further `compose.$job.yml` to swap them in/out if required. Example in https://git.coopcloud.tech/coop-cloud/loomio/src/commit/949f952ae435dfe7edf351dda9debfd0c1c3fe6d/compose.yml#L130-L131 you need to have https://git.coopcloud.tech/coop-cloud/swarm-cronjob running on the swarm first
Owner

Saw https://codeberg.org/bath.social/server/issues/6 btw /cc @nicksellen (happens to be open on the wrong recipe 🙃 but maybe useful info above also).

Saw https://codeberg.org/bath.social/server/issues/6 btw /cc @nicksellen (happens to be open on the wrong recipe 🙃 but maybe useful info above also).
Owner

This is the workaround that Autonomic is using meanwhile.

sudo crontab -e
# then add:
23 0 * * * docker exec $(docker ps -f 'name=YOUR_APP_NAME_app' --format '{{ .ID }}') /usr/local/bin/entrypoint.sh tootctl media remove --days=20
23 0 * * * docker exec $(docker ps -f 'name=YOUR_APP_NAME_app --format '{{ .ID }}') /usr/local/bin/entrypoint.sh tootctl media remove --remove-headers --days=30
This is the workaround that Autonomic is using meanwhile. ``` sudo crontab -e # then add: 23 0 * * * docker exec $(docker ps -f 'name=YOUR_APP_NAME_app' --format '{{ .ID }}') /usr/local/bin/entrypoint.sh tootctl media remove --days=20 23 0 * * * docker exec $(docker ps -f 'name=YOUR_APP_NAME_app --format '{{ .ID }}') /usr/local/bin/entrypoint.sh tootctl media remove --remove-headers --days=30 ```
Sign in to join this conversation.
No Label
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: coop-cloud/mastodon#1
No description provided.