mirror of https://github.com/zulip/zulip.git
backup: Set cwd while running pg_dump.
This avoids a spurious permission error inside the Postgres `resolve_symlinks` function if we don’t have access to the current working directory (e.g. we’re running with cwd /root inside `su zulip`). While we’re here, add a defensive `--` argument. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
parent
bc3b864754
commit
c6e60ebf0e
|
@ -64,7 +64,10 @@ class Command(ZulipBaseCommand):
|
||||||
|
|
||||||
db_name = settings.DATABASES["default"]["NAME"]
|
db_name = settings.DATABASES["default"]["NAME"]
|
||||||
db_dir = os.path.join(tmp, "zulip-backup", "database")
|
db_dir = os.path.join(tmp, "zulip-backup", "database")
|
||||||
run(["pg_dump", "--format=directory", db_name, "--file", db_dir])
|
run(
|
||||||
|
["pg_dump", "--format=directory", "--file", db_dir, "--", db_name],
|
||||||
|
cwd=tmp,
|
||||||
|
)
|
||||||
members.append("zulip-backup/database")
|
members.append("zulip-backup/database")
|
||||||
|
|
||||||
if settings.LOCAL_UPLOADS_DIR is not None and os.path.exists(
|
if settings.LOCAL_UPLOADS_DIR is not None and os.path.exists(
|
||||||
|
|
Loading…
Reference in New Issue