backup: Dereference symlinks when building tarball.

In docker-zulip installs, /etc/zulip/zulip.conf,
/etc/zulip/zulip-secrets.conf, and /home/zulip/uploads are all
symlinks into the `/data` directory which is mounted as a Docker
Volume.  By default, `tar` does not dereference symlinks, leading to
backups that are missing these critical pieces.

Add `-h` to the `tar` invocation, to follow symlinks, so backups in
Docker have all of their pieces.  Since none of the contents of the
backup intentionally use symlinks, this is safe.

Co-authored-by: Alex Vandiver <alexmv@zulip.com>
(cherry picked from commit d4b30e9e9d)
This commit is contained in:
bao-qian
2024-08-25 13:41:12 +08:00
committed by Tim Abbott
parent 1716818c07
commit 34b33b34f6

View File

@@ -133,7 +133,7 @@ class Command(ZulipBaseCommand):
[
"tar",
f"--directory={tmp}",
"-cPzf",
"-cPhzf",
tarball_path,
*transform_args,
"--",