Skip to content

Instantly share code, notes, and snippets.

@terabyte
Created March 25, 2022 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terabyte/d58f4f8eeefdb0e23673a29af5199044 to your computer and use it in GitHub Desktop.
Save terabyte/d58f4f8eeefdb0e23673a29af5199044 to your computer and use it in GitHub Desktop.
Autocommit script runs in a cron job every few minutes
#!/bin/bash
set -e
GIT_DIR=$HOME/projects/private_notes
git -C $GIT_DIR add -A
git -C $GIT_DIR commit -q -am "update from '$(hostname)' on $(date '+%Y%m%d %H:%M %Z')" > /dev/null || exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment