Skip to content

Commit 0896726

Browse files
committed
Add cron task
1 parent 0454d09 commit 0896726

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Taskfile.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,30 @@ tasks:
5858
cmds:
5959
- docker compose --env-file .env -f compose.yml stop
6060

61+
cron:
62+
desc: Manually run all necessary cron jobs, and get automation suggestions
63+
cmds:
64+
- |
65+
DOMAIN=$(grep ^DOMAIN= .env | cut -d '=' -f 2)
66+
echo "Executing check_notifications..."
67+
curl http://$DOMAIN:8080/jobs/check_notifications -f
68+
echo ""
69+
echo "Executing clean_up_database..."
70+
curl http://$DOMAIN:8080/jobs/clean_up_database -f
71+
echo ""
72+
echo "===================================================="
73+
echo "Automate job execution by adding the lines below to your crontab (crontab -e):"
74+
echo "===================================================="
75+
echo ""
76+
echo "# Run check_notifications every 10 minutes"
77+
echo "*/10 * * * * curl http://$DOMAIN:8080/jobs/check_notifications -f"
78+
echo ""
79+
echo "# Run clean_up_database once a week (Sunday at midnight)"
80+
echo "0 0 * * 0 curl http://$DOMAIN:8080/jobs/clean_up_database -f"
81+
echo ""
82+
echo "===================================================="
83+
84+
6185
_show_upgrade_notes:
6286
cmds:
6387
- |

0 commit comments

Comments
 (0)