Created
December 15, 2014 20:17
-
-
Save anthonywu/e4aee8a7f2c103d6988b to your computer and use it in GitHub Desktop.
Crontab Git Checkpointing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This is a legacy script from 2012 that auto-commits crontab contents to the learnsprout-prod repo. | |
if [ $# -lt 1 ]; then | |
echo "Usage: $(basename $0) <crontab|tbd>" | |
exit 1 | |
fi | |
cd $(dirname $0) | |
target=$1 | |
if [ "$target" = "crontab" -a -n "$(git status -s */crontab.cfg)" ]; then | |
git status -s */crontab.cfg | |
git commit -m "automated crontab checkpoint" */crontab.cfg | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment