diff --git a/source/app/controllers/util.py b/source/app/controllers/util.py index 0e02d1b..50601ca 100644 --- a/source/app/controllers/util.py +++ b/source/app/controllers/util.py @@ -1402,14 +1402,16 @@ def backup_dbs(): for rfc, data in rows: args = loads(data) + path_bk = _join(PATH_MEDIA, 'tmp', '{}.bk'.format(rfc.lower())) if args['type'] == 'postgres': - path_bk = _join(PATH_MEDIA, 'tmp', '{}.bk'.format(rfc.lower())) args = 'pg_dump -U postgres -Fc {} > "{}"'.format( args['name'], path_bk) - try: - result = _call(args) - except Exception as e: - log.info(e) + elif args['type'] == 'sqlite': + args = 'gzip -c "{}" > "{}"'.format(args['name'], path_bk) + try: + result = _call(args) + except Exception as e: + log.info(e) return