Max, that is not what the OP asked for. I believe he is asking if he can use the battery (as a backup) in his PSU.
The problem with a 12V source and a 7812 voltage regulator means that the output is less than 12V due to the drop from the regulator. One option is to bypass the regulator when the power is off. But you need to be careful that you don't supply 13V to components that cannot take the higher voltage.