Keep crontab history in git
This commit is contained in:
commit
19cb100786
|
@ -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
|
Loading…
Reference in New Issue