config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit d6de3f758941fcc6bf12f5e4db80148cb1846280
parent 05d39b236b1f4e730180227703da6e87e8e8c64c
Author: Jacob R. Edwards <n/a>
Date:   Sun, 27 Nov 2022 17:54:00 -0600

Add scripts to get and set a crontab

Diffstat:
Alocal/bin/bin/getcrontab | 5+++++
Alocal/bin/bin/installcrontab | 6++++++
Alocal/bin/bin/truncate | 5+++++
3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/local/bin/bin/getcrontab b/local/bin/bin/getcrontab @@ -0,0 +1,5 @@ +#!/bin/sh +# Copyright 2022 Jacob R. Edwards +# Get your current crontab. + +VISUAL=cat EDITOR=cat crontab -e 2>/dev/null diff --git a/local/bin/bin/installcrontab b/local/bin/bin/installcrontab @@ -0,0 +1,6 @@ +#!/bin/sh +# Copyright 2022 Jacob R. Edwards +# Install the given file as your new crontab. + +VISUAL=truncate EDITOR=truncate crontab -e < "$1" 2>&1 | + sed '/^crontab: installing new crontab$/d' 1>&2 diff --git a/local/bin/bin/truncate b/local/bin/bin/truncate @@ -0,0 +1,5 @@ +#!/bin/sh +# Copyright 2022 Jacob R. Edwards +# Write stdin to file (for use in installcrontab) + +cat > "$1"