From 6ee9936e1c8e09684c64c99725074e3ce46522e9 Mon Sep 17 00:00:00 2001 From: Christine Cunningham <5705329+ccunningham101@users.noreply.github.com> Date: Tue, 9 Jan 2024 17:15:57 +0000 Subject: [PATCH] Add cron job --- DEVELOPERS.md | 11 +++++++++++ deploy/get_mailgun_events.sh | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 deploy/get_mailgun_events.sh diff --git a/DEVELOPERS.md b/DEVELOPERS.md index dca1e32..45f18ff 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -205,6 +205,17 @@ increased to double. just run send_retraction_emails --live-run --limit=200 -v 3 ``` +#### Retrieve mailgun events + +Set up a cronjob so that mailgun logs will be added to the database every day. +Mailgun logs are stored for a few days, but in case the server is down, we do +not want to skip a day. + +This would get the logs once a day at 4am +```sh +00 04 * * * /home/retractobot-project/retractobot/deploy/get_mailgun_events.sh +``` + ## After the trial Once the follow-up time has ended diff --git a/deploy/get_mailgun_events.sh b/deploy/get_mailgun_events.sh new file mode 100644 index 0000000..c15878e --- /dev/null +++ b/deploy/get_mailgun_events.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +cd /home/retractobot-project/retractobot +# Add just to the path +export PATH="$PATH:/home/retractobot-project/bin" +just run retrieve_mailgun_events -v 1