dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit db10408035ced7fd6af14c677b690cf367f7a87f
parent 82ddc893f4b927dae8d2010566e103270d9969df
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Mon, 12 Feb 2018 06:30:38 -0500

Rework crontab again

Don't edit if .local/bin/my is already being called. Add some header
information, and a comment regarding pre-existing entries.

Diffstat:
M.local/bin/my-init | 20+++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/.local/bin/my-init b/.local/bin/my-init @@ -102,17 +102,23 @@ fi if __has "crontab" && [ -n "$crontab_init" ] then echo " Installing crontab" - localbin="$HOME/.local/bin" crontab -l > /tmp/crontab.$$.orig [ $? -ne 0 ] && echo "" > /tmp/crontab.$$.orig - cat >> /tmp/crontab.$$ <<-EOF -0 * * * * "\$HOME/.local/bin/my" cron + grep .local/bin/my /tmp/crontab.$$.orig > /dev/null 2>&1 + if [ ! $? -eq 0 ] + then + cat >> /tmp/crontab.$$ <<-EOF +# crontab created by my-init on `date '+%m/%d/%Y'` +# m h dom mon dow command +*/15 * * * * "\$HOME/.local/bin/my" cron + +# Entries below this line created manually EOF - cat /tmp/crontab.$$.orig >> /tmp/crontab.$$ - cat /tmp/crontab.$$ | crontab - rm /tmp/crontab.$$ + cat /tmp/crontab.$$.orig >> /tmp/crontab.$$ + cat /tmp/crontab.$$ | crontab + rm /tmp/crontab.$$ + fi rm /tmp/crontab.$$.orig - unset localbin fi # Vim plugins