commit 19cb100786729e5d3ee3d9dddfd477c72daa9e19 Author: Peter J. Holzer Date: Sat Jun 22 12:27:46 2024 +0200 Keep crontab history in git diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/crontab_edit b/crontab_edit new file mode 100755 index 0000000..7abf4f9 --- /dev/null +++ b/crontab_edit @@ -0,0 +1,21 @@ +#!/bin/sh +set -x +set -e +dir=~/.crontab +mkdir -p "$dir" +cd "$dir" +if [ ! -d .git ] +then + git init +fi +crontab -l > crontab +git add crontab +git status | grep "nothing to commit, working tree clean" || git commit +sensible-editor crontab +git add crontab +git commit +crontab crontab +if [ -n "$(git remote)" ] +then + git push -u +fi