Goal:

Create a pair of LED’s and push buttons on my RPi which can run scripts. One will shut down the Pi (updated here), the other will rsync a directory to a USB. Also I will read the status of a UPS. This may/will become more complicated since the UPS doesn’t have any useful interface (requiring an Arduino to:

Watch the UPS battery voltage and tell the RPi to power down.

Monitor whether mains power is applied.

Once mains is re-powered, restart the RPi after a UPS shut down using the hardware reset pins on the Pi.)

Instructions:

As in these RPi ubuntu instructions I installed python.. I removed sudo from the last command to make the command output happy