Last active
November 12, 2016 17:46
-
-
Save schtobia/39896d11a13d16ec79f7f172230692f3 to your computer and use it in GitHub Desktop.
Find and tar all changed config files in /etc. Kudos to blast_hardcheese https://serverfault.com/a/658796
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
[ -z "$1" ] && { (>&2 echo "Usage: $0 <backup.tar>"); exit 1; } | |
touch "$1" || { (>&2 echo "Cannot write to $1"); exit 1; } | |
find /etc -type f | grep -vFf <(debsums -e 2>/dev/null | sed 's/[[:space:]]*OK$//') | xargs tar cf "$1" 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment