From e1a5eaeb6891583fe0dfaef02c131c63586da280 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Fri, 1 Mar 2024 13:20:59 -0800 Subject: [PATCH] Install cron job to run `rails public_data:commit` weekly in production The Sunday 1:15am time was chosen pretty arbitrarily; I think having it happen at a "start of week" kind of weekday is clarifying for weekly tasks, but I chose ":15" mostly to mitigate that thing where cron jobs all run on the hour at the same time, while still feeling normal :p --- deploy/setup.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/deploy/setup.yml b/deploy/setup.yml index 2c30014f..19a104a2 100644 --- a/deploy/setup.yml +++ b/deploy/setup.yml @@ -437,6 +437,15 @@ mode: "755" state: directory + - name: Create weekly cron job to run `rails public_data:commit` + become_user: impress + cron: + name: "Impress: commit public data" + weekday: "0" # Sunday + hour: "1" # 1:15am + minute: "15" # 1:15am + job: "cd /srv/impress/current && bin/rails public_data:commit[scheduled]" + handlers: - name: Reload nginx systemd: