Re:A cheaper, smaller Raspberry Pi 3 is now available
by jburgess777 on Thursday November 15, 2018 @07:53PM
(#18465173)
You might want to look at some of the 'Pi UPS' systems which have been developed. Once they indicate the power has failed you can start a graceful shut down. One example can be found here:
https://pi.gate.ac.uk/pages/mopi.html