Skip to content

Instantly share code, notes, and snippets.

@amercier
Last active December 25, 2015 10:19
Show Gist options
  • Save amercier/6961063 to your computer and use it in GitHub Desktop.
Save amercier/6961063 to your computer and use it in GitHub Desktop.
root's crontab on MacOS X Moutain Lion. Contains auto-updates for npm and gem.
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/mysql/bin
L=/var/log/cron
0 * * * * ([-d $L]||mkdir $L) && (echo -n "$(date) Updating NPM... " && npm -g update > /dev/null 2>> $L/npm-error.log && echo OK || echo NOK) >> $L/npm.log
0 * * * * ([-d $L]||mkdir $L) && (echo -n "$(date) Updating Gems... " && gem update > /dev/null 2>> $L/gem-error.log && echo OK || echo NOK) >> $L/gem.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment