> I have an uninterruptible power supply (UPS). It is basically a surge protector with a big battery in it. So if the power goes out, it automatically falls back to the battery and you can still squeeze another X hours of juice out of it until the main power comes back on.Often just minutes if you're running them near their rated power. Conventional UPSs are generally designed to power your devices just long enough to shut down your computer "safely" [1] or to start a generator. They advertise power ratings but typically not battery capacity at all, and that's because it sucks.
2026 update: don't buy a (conventional, lead-acid battery) UPS. Buy a LifePo4 power station instead. They're actually designed to keep your devices running for hours without main power. They used to not fail over quickly enough to avoid a typical machine going down (briefly), but now they commonly advertise 10ms to 20ms switchover. Also, you don't need to replace the batteries nearly as often. Like, once every 10 years instead of once every 3 years. And the price has really fallen recently. LifePo4 is (unlike some other lithium ions) known as a particularly safe chemistry, so you don't have to worry about fire risk.
[1] This matters if you have crappy software and/or hardware that loses data if shut down uncleanly. If you use modern SSD/HDDs that flush their write caches when asked to, modern journaled filesystems at their default settings, and modern databases like SQLite or PostgreSQL at their default settings, you should be fine just pulling the power plug any time you feel like it.