Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bstarynk/helpcovid for better loc…
Browse files Browse the repository at this point in the history
…alization of login form
  • Loading branch information
bstarynk committed Apr 2, 2020
2 parents a04fd09 + dabb9c3 commit bdbabbd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backup-database.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os
import pwd
import time



Expand Down Expand Up @@ -65,16 +66,18 @@ def parse_connection_string(connstr):
return keys


def backup(keys):

cmd = "sudo pg_dump -U {0} -h {1} -p {2} {3} | gzip > backup.gz".format(
keys["user"], keys["host"], keys["port"], keys["dbname"])
def backup(keys):
fname = time.strftime("helpcovid_db-%Y-%m-%d-%H-%M-%S", time.gmtime())
cmd = "sudo pg_dump -U {0} -h {1} -p {2} {3} | gzip > {4}.gz".format(
keys["user"], keys["host"], keys["port"], keys["dbname"], fname)

print("Starting database backup...")
print(cmd)
os.system(cmd)



def main():
print("Starting HelpCovid database backup...")
print("See https://github.com/bstarynk/helpcovid and its README.md\n")
Expand Down

0 comments on commit bdbabbd

Please sign in to comment.