Multiple power input to arduino


For one of my project . am considering the following scenario to avoid power interrupt to my Ardunio UNO

  1. i want to connect Arduino UNO with 12 V power adapter connected to Ac power and the on power jack
    of Arduino to work when i have power from grid .

  2. connecting a battery /Power bank to arduino USB to switch power when power from grid is OFF .

is it safe to connect both simultaneously to Arduino Board ?

Will this arrangement work as expected ?

Thanks for the support

Or, power the Uno from the powerbank, and keep the powerbank charged with a cellphone charger.

I run a WeMos D1 mini like that for ~36hours on a 5Ah powerbank.

You might have to add a circuit to an Uno to keep the powerbank alive (was not needed for the WeMos).