Skip to content

Commit 737e2db

Browse files
committed
Add continuous mode
1 parent f449afc commit 737e2db

File tree

5 files changed

+579
-436
lines changed

5 files changed

+579
-436
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,27 @@ On the receiving end, suppose we download with 32 TCP connections:
4848

4949
File modification timestamps are preserved during all transfers.
5050

51-
## Incremental transfers
51+
## Continuous mode
5252

53-
Fastsync supports incremental transfers with the `--incremental` flag. When enabled, fastsync will:
53+
Fastsync supports continuous mode with the `--continuous` flag. When enabled, fastsync will:
5454

5555
1. Compare files by name, size, and modification timestamp
5656
2. Skip files that already exist at the destination with matching size and timestamp
5757
3. Transfer only files that are missing or have different size/timestamp
58+
4. Keep syncing in rounds with a 2-second delay between rounds
59+
5. After each transfer round, wait and then re-scan the source files
60+
6. If changes are detected in the new scan, start another sync round
61+
7. Stop when 5 consecutive rounds finish with no changes detected
5862

59-
Both sender and receiver must use the `--incremental` flag:
63+
Both sender and receiver must use the `--continuous` flag:
64+
65+
# Receiver
66+
fastsync recv <ip>:<port> 32 --continuous
6067

6168
# Sender
62-
fastsync send 100.71.154.83:4440 --incremental file.tar.gz
69+
fastsync send --continuous <ip>:<port> ./data
6370

64-
# Receiver
65-
fastsync recv 100.71.154.83:4440 32 --incremental
71+
**Note:** Continuous mode only handles file additions and modifications. File deletions from the sender are not propagated to the receiver - files that exist at the destination will remain even if they're removed from the source.
6672

6773
## Testing
6874

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
2-
channel = "1.74.0"
2+
channel = "1.75.0"
33
components = ["rustc", "cargo", "rustfmt", "clippy"]
44
targets = [
55
# Default regular build.

0 commit comments

Comments
 (0)