aboutsummaryrefslogtreecommitdiffstats
path: root/roles/host/templates
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2026-05-17 13:35:43 +0300
committerJan Tuomi <jan@jantuomi.fi>2026-05-17 19:32:16 +0300
commitb38e910899bad2d6ae2049b599dcdd525420c53d (patch)
treec6b277aafe1e6e278368dc5ca25a4acd624b20d2 /roles/host/templates
parentc1a39b7e43bed135cb1832b2b5da7c82bf7a4c78 (diff)
Fix postgres
Diffstat (limited to 'roles/host/templates')
-rw-r--r--roles/host/templates/etc_crontab.j26
-rw-r--r--roles/host/templates/usr_local_bin_logto.sh.j247
2 files changed, 3 insertions, 50 deletions
diff --git a/roles/host/templates/etc_crontab.j2 b/roles/host/templates/etc_crontab.j2
index de1f3c6..5cd0d86 100644
--- a/roles/host/templates/etc_crontab.j2
+++ b/roles/host/templates/etc_crontab.j2
@@ -22,11 +22,11 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
1,31 0-5 * * * root adjkerntz -a
# Take snapshots every day at 3:05 AM
-5 3 * * * root logto /var/log/backup /usr/local/bin/backup snapshot prune-local
+5 3 * * * root /usr/local/bin/backup snapshot prune-local >>/var/log/backup 2>&1
# Send backup snapshots to remote every third day at 4:05 AM
-5 4 */3 * * root logto /var/log/backup /usr/local/bin/backup send-to-remote prune-remote notify
+5 4 */3 * * root /usr/local/bin/backup send-to-remote prune-remote notify >>/var/log/backup 2>&1
-# Run pylogmonitor
+# Run pylogsentinel
*/10 * * * * root python -m pylogsentinel
# Run pylogsentinel batch job once a day
5 6 * * * root /usr/local/bin/pylogsentinel-batch-email.sh
diff --git a/roles/host/templates/usr_local_bin_logto.sh.j2 b/roles/host/templates/usr_local_bin_logto.sh.j2
deleted file mode 100644
index 9bb5aa1..0000000
--- a/roles/host/templates/usr_local_bin_logto.sh.j2
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-
-set -ue
-
-# Wrapper for logging to file and prepending a timestamp.
-# By default writes both stdout and stderr to the log file.
-
-usage() {
- echo "Usage: logto [-s|-e] <log_file> <command>"
- echo "Flags:"
- echo " -s: Write only stdout to the log file."
- echo " -e: Write only stderr to the log file."
- echo ""
- echo "Example usage:"
- echo " logto /var/log/my.log run some command"
- exit 1
-}
-
-mode="all"
-
-while getopts "se" opt; do
- case $opt in
- s) mode="stdout" ;;
- e) mode="stderr" ;;
- *) usage ;;
- esac
-done
-shift $((OPTIND-1))
-
-if [ $# -lt 2 ]; then
- usage
-fi
-
-log_file="$1"
-shift
-
-if [ "$mode" = "stdout" ]; then
- out=$(2>/dev/null $@)
-elif [ "$mode" = "stderr" ]; then
- out=$(2>&1 >/dev/null $@)
-else
- out=$(2>&1 $@)
-fi
-
-if [ ! -z "$out" ]; then
- echo "$(date +"%Y-%m-%dT%H:%M:%S%z")" "$out" >>"$log_file"
-fi