Posted on Jan 19, 2010

Disk Utility: The underlying task reported failure on exit (-9972)

Hello, Disk Utility. You’re usually a great tool. Not today. All I wanted to do was Verify Disk Permissions and you would immediately spit back at me:

Error detected while verifying/repairing permissions on disk4s2 Server HD: The underlying task reported failure on exit (-9972)

There were no physical disk errors reported and I just had a gut feeling that there was something else going on.

Turns out, there was. /Library/Receipts. This directory is incredibly hard to find documentation on, which is why I’m writing about it here.

The problem:
Permissions for the entire Disk Utility receipts directory structure was wrong causing it to error immediately upon check.

ls -l /Library/Receipts
drwxr-xr-x 31 axl admin 1054 Nov 23 13:41 boms
drwxr-xr-x 3 axl admin 102 Jan 12 16:50 db

The fix:
Recursively give the boms & db folders the right permissions.

chown -R _installer:wheel /Library/Receipts/boms
chown -R _installer:admin /Library/Receipts/db

ls -l /Library/Receipts
drwxr-xr-x 31 _installer wheel 1054 Nov 23 13:41 boms
drwxr-xr-x 3 _installer admin 102 Jan 13 10:46 db

Posted on Feb 18, 2008

OS X bash script to download entire picasaweb albums

I found this great tool to download an entire picasaweb album except it didn’t work in OS X. After a quick search on a couple of man pages I found the difference when using OS X’s mktemp and fixed things. Now I can easily grab my favorite albums from friends and family and load them into iPhoto. What a huge time-saver!


#!/bin/bash
# Distributed under the terms of the GNU General Public License v3 or later
# AUTHOR: Lo?c Cerf
# e-mail: magicbanana@gmail.com
WGET_OPT="-q -T 180 -t 3 -c"
EX_USAGE=64
EX_NOHOST=68
if [ -z "$1" -o "$1" = "--help" -o "$1" = "-h" ]
then
echo "Usage: $0 url [destination]"
exit
fi
page=${1#*picasaweb.google.*/}
if [ "$page" = "$1" ]
then
echo "\"$1\" is not the URL of a PicasaWeb album or gallery" 1>&2
exit $EX_USAGE
fi
tempfoo=`basename $0`
temp=`mktemp ${tempfoo}.XXXXXX` || exit 1
if wget $WGET_OPT -O $temp "$1"
then
finalPage=${page#*/}
if [ -z "$finalPage" -o "$finalPage" = "$page" ]
then
# $temp is a gallery
if [ -z "$2" ]
then
destination=`grep -m 1 "^var _user" $temp`
destination=${destination##*nickname:\"}
set "$1" "${destination%%\"*}"
fi
mkdir -p "$2"
cd "$2"
grep -E -o "$1"[/]?[[:alnum:]:.%~_-]+ $temp | sort | uniq |
while read album
do
"$0" $album &
done
else
# $temp is an album
if [ -z "$2" ]
then
destination=`grep -m 1 "^var _album" $temp`
destination=${destination##*title:\"}
set "$1" "${destination%%\"*}"
fi
grep -E -o {id:\"[0-9]+\",s:\"[[:alnum:]:\\.%~_-]+ $temp |
while read picture
do
picture=${picture##*\"}
picture=${picture/\x2Fs144/}
wget $WGET_OPT -P "$2" ${picture//\x2F//} &
done
fi
else
exit $EX_NOHOST
fi
rm $temp