Skip to content

Instantly share code, notes, and snippets.

@anthonywu
Created December 15, 2014 20:17
Show Gist options
  • Save anthonywu/e4aee8a7f2c103d6988b to your computer and use it in GitHub Desktop.
Save anthonywu/e4aee8a7f2c103d6988b to your computer and use it in GitHub Desktop.
Crontab Git Checkpointing
#!/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