Skip to content

Instantly share code, notes, and snippets.

@makimoto
Created July 19, 2011 06:02
Show Gist options
  • Save makimoto/1091435 to your computer and use it in GitHub Desktop.
Save makimoto/1091435 to your computer and use it in GitHub Desktop.
#!/bin/sh
# set crontab such as:
# 30 6 * * * /bin/sh /path/to/mail_daily_commit_logs.sh
TO='example@example.org'
FROM='example@example.org'
REPO_PATH='/path/to/rails/'
cd $REPO_PATH
/usr/local/bin/git pull
/usr/local/bin/git log --after="`date --rfc-3339=date -d'1 day ago'` 06:00:00 +0900" --before="`date --rfc-3339=date` 05:59:59 +0900" | mail $TO -s "daily commit log : `date --rfc-3339=date -d'1 day ago'`" -- -f $FROM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment