#5443·kopia

--upload-limit-mb 限制应用于哈希步骤,而非上传步骤

作者: kit299创建于 2026年6月23日更新于 2026年9月14日

`kopia snapshot create` has a flag `--upload-limit-mb` with the description "Stop the backup process after the specified amount of data (in MB) has been uploaded." In theory, this could be used to limit the amount of data that is uploaded in a single execution - however, the limit is applied to the amount of data that is hashed, not the amount uploaded. That is - the flag functions as though it were `--hashing-limit-mb`. This causes the snapshot to abort prematurely in situations when it could have run to completion. For example, if a file is encountered that is new/unknown but has previously been backed up. Here's an example sequence that demonstrates the issue. * Show a folder containing a single file (the Kopia 0.23 zip). * Create a snapshot of that file * Copy the file with a new name * Create another snapshot In theory, the 2nd snapshot should succeed because it does not need to upload any data (beyond about 200 bytes of metadata), yet setting a 5MB upload limit causes it to abort. C:\TestFolder>dir Volume in drive C has no label. Volume Serial Number is 162E-F6AE Directory of C:\TestFolder 06/23/2026 01:58 <DIR> . 06/15/2026 22:10 16,807,707 kopia-0.23.0-windows-x64.zip 1 File(s) 16,807,707 bytes 1 Dir(s) 18,806,448,128 bytes free C:\TestFolder>kopia snapshot create C:\TestFolder Snapshotting TestUser@TestHost:C:\TestFolder ... * 0 hashing, 1 hashed (16.8 MB), 0 cached (0 B), uploaded 192 B, estimating... Created snapshot with root kd835558e75e88cd9ec4e8a49c5fe1f62 and ID 66f334f2e6b13f5eb4aa08a18d9a1fca in 0s C:\TestFolder>copy kopia-0.23.0-windows-x64.zip kopia-0.23.0-windows-x64---COPY---.zip 1 file(s) copied. C:\TestFolder>kopia snapshot create C:\TestFolder --upload-limit-mb 5 Snapshotting TestUser@TestHost:C:\TestFolder ... * 0 hashing, 1 hashed (5.3 MB), 0 cached (0 B), uploaded 192 B, estimating... Created partial snapshot with root k2ecf81dfef1874c6f8472a19e781bf57 and ID c80e6cc4da43d62058dd3cd462e0acb6 in 0s The abort reason can be confirmed with `snapshot list` showing "incomplete: limit reached": C:\TestFolder>kopia snapshot list C:\TestFolder --incomplete TestUser@TestHost:C:\TestFolder 2026-06-23 01:59:03 UTC kd835558e75e88cd9ec4e8a49c5fe1f62 16.8 MB drwxrwxrwx files:1 dirs:1 (latest-1,hourly-1,daily-1,weekly-1,monthly-1,annual-1) 2026-06-23 01:59:30 UTC k2ecf81dfef1874c6f8472a19e781bf57 incomplete:limit reached 0 B drwxrwxrwx files:0 dirs:1 (incomplete) In fact, in situations like this (where there is a file in the repository that is larger than the upload limit) it seems no progress can be made and no matter how many times you attempt to create the snapshot, it will fail - even though no actual data upload is required. Tested on Windows with `0.23.0 build: 981d5f95ad7b64f834c46b7ac244d524644fbb46 from: kopia/kopia` using S3 repository.