Remove bash -c prefix for pg_dump command

need to keep the `sudo -u postgres pg_dump ..` part as simple as
possible, since must declare `sudoers` allowance for that
This commit is contained in:
Lance Edgar 2023-09-17 11:10:48 -05:00
parent 24d632b7e3
commit ae7cb45ab3

View file

@ -28,7 +28,6 @@ import os
import re
from rattail_fabric2 import apt, append, contains, sed, uncomment
from rattail.util import shlex_join
def install(c):
@ -224,7 +223,6 @@ def dump_db(c, name, port=None, exclude_tables=None,
if skip_raw_file:
tmp_name = f'/tmp/{gz_name}'
cmd = f'{cmd} | gzip -c > {tmp_name}'
cmd = shlex_join(['bash', '-c', cmd])
c.sudo(cmd, user='postgres')
# TODO: should remove this file
c.run(f"cp {tmp_name} {gz_name}")