mirror of https://github.com/zulip/zulip.git
backup: Add option `--skip-uploads` to skip uploads backup.
This commit is contained in:
parent
984d3f2f0e
commit
32cf192b9b
|
@ -346,6 +346,7 @@ su zulip -c '/home/zulip/deployments/current/manage.py backup'
|
||||||
|
|
||||||
The backup tool provides the following options:
|
The backup tool provides the following options:
|
||||||
- `--skip-db`: If set, the tool will skip the backup of your database.
|
- `--skip-db`: If set, the tool will skip the backup of your database.
|
||||||
|
- `--skip-uploads`: If set, the tool will skip the backup of the uploads.
|
||||||
|
|
||||||
This will generate a `.tar.gz` archive containing all the data stored
|
This will generate a `.tar.gz` archive containing all the data stored
|
||||||
on your Zulip server that would be needed to restore your Zulip
|
on your Zulip server that would be needed to restore your Zulip
|
||||||
|
|
|
@ -26,6 +26,7 @@ class Command(ZulipBaseCommand):
|
||||||
"output", default=None, nargs="?", help="Filename of output tarball"
|
"output", default=None, nargs="?", help="Filename of output tarball"
|
||||||
)
|
)
|
||||||
parser.add_argument("--skip-db", action='store_true', help="Skip database backup")
|
parser.add_argument("--skip-db", action='store_true', help="Skip database backup")
|
||||||
|
parser.add_argument("--skip-uploads", action='store_true', help="Skip uploads backup")
|
||||||
|
|
||||||
def handle(self, *args: Any, **options: Any) -> None:
|
def handle(self, *args: Any, **options: Any) -> None:
|
||||||
timestamp = timezone_now().strftime(TIMESTAMP_FORMAT)
|
timestamp = timezone_now().strftime(TIMESTAMP_FORMAT)
|
||||||
|
@ -74,7 +75,7 @@ class Command(ZulipBaseCommand):
|
||||||
)
|
)
|
||||||
members.append("zulip-backup/database")
|
members.append("zulip-backup/database")
|
||||||
|
|
||||||
if settings.LOCAL_UPLOADS_DIR is not None and os.path.exists(
|
if not options['skip_uploads'] and settings.LOCAL_UPLOADS_DIR is not None and os.path.exists(
|
||||||
os.path.join(settings.DEPLOY_ROOT, settings.LOCAL_UPLOADS_DIR)
|
os.path.join(settings.DEPLOY_ROOT, settings.LOCAL_UPLOADS_DIR)
|
||||||
):
|
):
|
||||||
members.append(
|
members.append(
|
||||||
|
|
Loading…
Reference in New Issue