Before any of you guys are crazy enough to do something like this try not to follow whats pictured here. As you may not know, you have a higher chance of electricuting yourself with DC current then AC. With 24volts on 2 batteries thats a lot of amperage there!
First take notice that there are no fuses anywhere on any leg on the battery and in between the battery. I'd suggest you put on in place. Second put fuses between the batteries and also on the terminals where it plugs into the ups. Third don't use automotive battery unless you got a fat wallet. The anode side of the battery is made from very thin cell walls that are designed to have a very very high surface area. The more surface area it has the more electrons flow from anode to cathode (ie higher amperage.) Thats why car batteries are good for starting. However you run them down long enough and there won't be any material left to reverse the cycle! Thats why they make marine deep cycle batteries (thicker walls and are designed to be run to a deep discharge but less starting amps). Ideally you'd want a golf cart battery which allows deep discharge and ability to quickly recharge.
I"m not saying this idea sucks (I have 4 deep cycle marine battery hooked up to my APC UPS 3000), I'm just saying you need to be careful. Also for reference, apc ups 3000 idles at 1amp with nothing plugged in, will power a 500-1000watt holegen lamp (I can't remember the wattage of my floor light) for 8 hours roughly from a full charge before beeping.
andy