summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-04-21 20:09:13 +0300
committerPaul Buetow <paul@buetow.org>2023-04-21 20:09:13 +0300
commit72d248eba6f0e8a2e300f0ba9f70ba10d0f0c9c8 (patch)
tree180c117256d6c90cf6f36f8d7425fa111e580be2 /frontends
parent155420490e74ee430993e1bb43383a462e4b8354 (diff)
add cron template
Diffstat (limited to 'frontends')
-rw-r--r--frontends/Rexfile7
-rw-r--r--frontends/etc/gogios.cron.tpl2
2 files changed, 6 insertions, 3 deletions
diff --git a/frontends/Rexfile b/frontends/Rexfile
index dbc37d8..d887e6a 100644
--- a/frontends/Rexfile
+++ b/frontends/Rexfile
@@ -8,7 +8,7 @@
# Rex is programmed in Perl and there is already Perl in the base system of OpenBSD.
# Also, I find Perl > Python (my personal opinion).
-use Rex -feature => ['1.13'];
+use Rex -feature => ['1.14'];
use Rex::Logger;
use File::Slurp;
@@ -425,8 +425,9 @@ task 'gogios', group => 'frontends',
file '/tmp/gogios.cron',
ensure => 'file',
- content => "*/5 8-22 * * * $gogios_path >/dev/null\n0 7 * * * $gogios_path -renotify >/dev/null\n",
- mode => '755';
+ content => template('./etc/gogios.cron.tpl',
+ gogios_path => $fqdns),
+ mode => '600';
run 'cat /tmp/gogios.cron | crontab -u _gogios -';
run 'rm /tmp/gogios.cron';
diff --git a/frontends/etc/gogios.cron.tpl b/frontends/etc/gogios.cron.tpl
new file mode 100644
index 0000000..ba06781
--- /dev/null
+++ b/frontends/etc/gogios.cron.tpl
@@ -0,0 +1,2 @@
+0 7 * * * <%= $gogios_path %> -renotify >/dev/null
+*/5 8-22 * * * <%= $gogios_path %> >/dev/null