Skip to content

Instantly share code, notes, and snippets.

@miketheman
Last active May 24, 2016 22:52
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 miketheman/e8619f16303660c50d5335c700cb362a to your computer and use it in GitHub Desktop.
Save miketheman/e8619f16303660c50d5335c700cb362a to your computer and use it in GitHub Desktop.
Bash function to diff most recent Chef backup. Place in `/etc/profile.d/chefdiff.sh`
# Usage: `chefdiff <filename>`
chefdiff() {
p=`readlink -f $1`
f=`ls /var/chef/backup$p* | sort | tail -n 1`
diff -u $f $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment