I have a raspberry PI in the car and the power goes off when the ignition goes off which means it doesn't shutdown nicely. I'm not sure if this has caused a problem because there have been alot of other intermittency issues, but I imagine it would be better to shutdown nicely.
I was wondering about the possibility of having a UPS for the pi that lasts just long enough for it to shutdown.
ie a rechargable battery, that charges when the power is on and when the power is off, it provides enough for the Pi to go through its shutdown procedure. I imagine a small box with a micro usb input, microusb output to go in the pi and a wire to go to a gpio pin and is 3.3V or 0V depending on whether there is external power or not. a background process could poll the pin every 30 seconds or so and shutdown the pi when the external power goes off. it would only need power for a minute or so.
any ideas or has this been done to death elsewhere? i couldnt find anything