From 365f9c23c9ac70201013f607982e9ab9e6a1b7f6 Mon Sep 17 00:00:00 2001 From: sev Date: Thu, 5 Aug 2021 05:08:18 -0500 Subject: [PATCH] testing/cronwrap: new aport --- testing/cronwrap/APKBUILD | 19 +++++++++++++++++++ testing/cronwrap/cronwrap | 7 +++++++ 2 files changed, 26 insertions(+) create mode 100644 testing/cronwrap/APKBUILD create mode 100644 testing/cronwrap/cronwrap diff --git a/testing/cronwrap/APKBUILD b/testing/cronwrap/APKBUILD new file mode 100644 index 0000000..13b4788 --- /dev/null +++ b/testing/cronwrap/APKBUILD @@ -0,0 +1,19 @@ +# Contributor: sev +# Maintainer: sev +pkgname=cronwrap +pkgver=1.0.0 +pkgrel=0 +pkgdesc="Pipe a command's output to a logfile with datestamps" +url="https://git.sev.monster/aports.git" +arch="noarch" +license="WTFPL" +source="cronwrap" +options="!check" + +package() { + install -Dm755 cronwrap "$pkgdir"/usr/bin/cronwrap +} + +sha512sums=" +1d89508f7b1683a802e1c3c09794e22c17ab26fec2c3ec7023c588b56a7ed609f111aed917fcd81af11df6c2ec832ca3fe196436cbf9eb609746c07552d46769 cronwrap +" diff --git a/testing/cronwrap/cronwrap b/testing/cronwrap/cronwrap new file mode 100644 index 0000000..a0e501f --- /dev/null +++ b/testing/cronwrap/cronwrap @@ -0,0 +1,7 @@ +#!/bin/sh +set -eu +set -o pipefail + +"$@" 2>&1 \ + | awk "{print strftime(\"%b %d %H:%M:%S `hostname -s` info $1[$$] \"), \$0; fflush();}" \ + | tee -a "/var/log/$1.cron.log" -- 2.46.2