and i would like to share.
The code provides in backing up the globals by means of pg_dumpall -g
The wiki says i need to ask for editing privileges.
BTW nice script. And it could yet be expanded with support for multiple clusters. There is some possible example code in Debian's postgresql-common pg_lsclusters, which is written in perl.