Skip to content

Instantly share code, notes, and snippets.

@falconindy
Created May 31, 2013 18:54
Show Gist options
  • Save falconindy/5687111 to your computer and use it in GitHub Desktop.
Save falconindy/5687111 to your computer and use it in GitHub Desktop.
#!/bin/bash
check_backup() {
[[ -f $1 ]] && echo "$1"
}
awk '/^%BACKUP%$/ {
while (getline) {
if (/^$/) { nextfile }
print $1
}
}' /var/lib/pacman/local/*/files | while read -r bkup; do
check_backup "/$bkup.pacnew"
check_backup "/$bkup.pacorig"
check_backup "/$bkup.pacsave"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment