PHP or Shell script for FreePBX Restore backup File

Can anyone share PHP or shell script to restore backup on monthly basis in secondary server.
Thanks in advance

You don’t need a custom PHP or Shell script. That functionality comes built in as a “Warm Spare”.

https://wiki.freepbx.org/display/fpg/warm+spare+setup