[CG] : add fct dump database
This commit is contained in:
parent
079f22ae3a
commit
0d2b1fa9c6
@ -406,3 +406,12 @@ def Polygons_to_MultiPolygon(df,geom_col=None):
|
|||||||
df = concat([multi,poly])
|
df = concat([multi,poly])
|
||||||
df.sort_index(inplace=True)
|
df.sort_index(inplace=True)
|
||||||
return df
|
return df
|
||||||
|
|
||||||
|
def dump_bd(host,bd_name, user):
|
||||||
|
from os import system
|
||||||
|
from datetime import datetime as dt
|
||||||
|
date = dt.today().date().isoformat().replace('-','')
|
||||||
|
cmd = 'pg_dump -h {h} -U {u} -W -F c {bd} > {bd}_{dat}.dump'.format(
|
||||||
|
h=host,u=user,bd=bd_name,dat=date
|
||||||
|
)
|
||||||
|
system(cmd)
|
||||||
Loading…
x
Reference in New Issue
Block a user