Great post over on RepairHub for a battery backup / UPS for the Raspberry Pi. If power is lost the setup will continue to power the Pi for a few minutes (configurable) then shut it down safely. If power is resumed the shutdown will be canceled.
This setup has the added advantage over some of the other battery backup solutions in that it also charges the battery backup at the same time.
Suggested power supply is a 12 volt 3 amp device which should be sufficient to power external hard disks also. The Pi is powered by a UBIC which converts the 12 volts down to 5 volts suitable for the Pi.