sftp-push-sync 2.5.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -6
- package/README.md +11 -4
- package/bin/sftp-push-sync.mjs +5 -1
- package/package.json +1 -1
- package/src/core/SftpPushSyncApp.mjs +387 -74
- package/src/core/SyncLogger.mjs +18 -6
- package/src/helpers/compare.mjs +82 -89
- package/src/helpers/hash-cache-leveldb.mjs +299 -0
- package/src/helpers/hash-cache-ndjson.mjs +423 -0
- package/src/helpers/hashing.mjs +39 -7
- package/src/helpers/walkers.mjs +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [
|
|
3
|
+
## [3.0.1] - 2026-03-05
|
|
4
|
+
|
|
5
|
+
- stability improvements especialy during large and longtime uploads, error handling, log with datetime.
|
|
6
|
+
|
|
7
|
+
## [3.0.0] - 2026-03-04
|
|
8
|
+
|
|
9
|
+
- Switched from JSON-file based hash cache to NDJSON-based Cache-implementation.
|
|
10
|
+
- Disk-based, only active entries in RAM
|
|
11
|
+
- Scales to 100,000+ files without memory issues
|
|
12
|
+
- Auto-persist (no explicit saving required)
|
|
13
|
+
- Auto-migration - Existing JSON cache is automatically migrated
|
|
14
|
+
|
|
15
|
+
## [2.5.0] - 2026-03-04
|
|
4
16
|
|
|
5
17
|
- Parallel remote walker walkers.mjs: scans 8 directories simultaneously
|
|
6
18
|
- Batch analysis with concurrency compare.mjs: 8 file comparisons in parallel
|
|
7
19
|
- Parallel hash calculation: local + remote hash simultaneously
|
|
8
|
-
- Keep-alive: SftpPushSyncApp.mjs prevents server disconnection
|
|
9
|
-
|
|
10
|
-
## [2.3.0] - 2026-03-04
|
|
11
|
-
|
|
12
|
-
- Keep-Alive enabled - a Keep-Alive packet is sent every 10 seconds.
|
|
20
|
+
- Keep-alive: SftpPushSyncApp.mjs prevents server disconnection. A Keep-Alive packet is sent every 10 seconds.
|
|
13
21
|
|
|
14
22
|
## [2.1.0] - 2025-11-19
|
|
15
23
|
|
package/README.md
CHANGED
|
@@ -19,13 +19,18 @@ Features:
|
|
|
19
19
|
- adds, updates, deletes files
|
|
20
20
|
- text diff detection
|
|
21
21
|
- Binary files (images, video, audio, PDF, etc.): SHA-256 hash comparison
|
|
22
|
-
- Hashes are cached in
|
|
22
|
+
- Hashes are cached in `.sync-cache.*.ndjson`
|
|
23
23
|
- Parallel uploads/deletions via worker pool
|
|
24
24
|
- include/exclude patterns
|
|
25
25
|
- Sidecar uploads / downloads - Bypassing the sync process
|
|
26
26
|
|
|
27
27
|
The file `sftp-push-sync.mjs` is pure JavaScript (ESM), not TypeScript. Node.js can execute it directly as long as "type": "module" is specified in package.json or the file has the extension .mjs.
|
|
28
28
|
|
|
29
|
+
## Breaking changes in 3.0.0
|
|
30
|
+
|
|
31
|
+
- New Cache Mechanism: NDJSON instead of JSON.
|
|
32
|
+
- The cache can now handle any number of files.
|
|
33
|
+
|
|
29
34
|
## Breaking changes in 2.0.0
|
|
30
35
|
|
|
31
36
|
- The flags `--upload-list` / `--download-list` have been replaced by
|
|
@@ -99,6 +104,7 @@ Create a `sync.config.json` in the root folder of your project:
|
|
|
99
104
|
"analyzeChunk": 1
|
|
100
105
|
},
|
|
101
106
|
"logLevel": "normal",
|
|
107
|
+
"logTimestamps": false,
|
|
102
108
|
"logFile": ".sftp-push-sync.{target}.log"
|
|
103
109
|
}
|
|
104
110
|
```
|
|
@@ -199,6 +205,7 @@ sftp-push-sync prod --sidecar-download --skip-sync
|
|
|
199
205
|
Logging can also be configured.
|
|
200
206
|
|
|
201
207
|
- `logLevel` - normal, verbose, laconic.
|
|
208
|
+
- `logTimestamps` - true/false. When enabled, each log line is prefixed with a timestamp `[YYYY-MM-DD HH:mm:ss.SSS]`.
|
|
202
209
|
- `logFile` - an optional logFile.
|
|
203
210
|
- `scanChunk` - After how many elements should a log output be generated during scanning?
|
|
204
211
|
- `analyzeChunk` - After how many elements should a log output be generated during analysis?
|
|
@@ -253,12 +260,12 @@ However, it should also manage directories:
|
|
|
253
260
|
|
|
254
261
|
## Which files are created?
|
|
255
262
|
|
|
256
|
-
- The cache files: `.sync-cache.*.json`
|
|
263
|
+
- The cache files: `.sync-cache.*.ndjson`. The old ones can be deleted: `.sync-cache.*.json`
|
|
257
264
|
- The log file: `.sftp-push-sync.{target}.log` (Optional, overwritten with each run)
|
|
258
265
|
|
|
259
266
|
You can safely delete the local cache at any time. The first analysis will then take longer, because remote hashes will be streamed again. After that, everything will run fast.
|
|
260
267
|
|
|
261
|
-
Note 1: The first run always takes a while, especially with lots of media – so be patient! Once the cache is full, it will be faster.
|
|
268
|
+
Note 1: The first run always takes a while, especially with lots of media – so be patient! Once the cache is full, it will be faster.
|
|
262
269
|
Note 2: Reliability and accuracy are more important to me than speed.
|
|
263
270
|
|
|
264
271
|
## Example Output
|
|
@@ -270,4 +277,4 @@ Note 2: Reliability and accuracy are more important to me than speed.
|
|
|
270
277
|
- <https://www.npmjs.com/package/sftp-push-sync>
|
|
271
278
|
- <https://github.com/cnichte/sftp-push-sync>
|
|
272
279
|
- <https://www.npmjs.com/package/hugo-toolbox>
|
|
273
|
-
- <https://carsten-nichte.de>
|
|
280
|
+
- <https://carsten-nichte.de>
|
package/bin/sftp-push-sync.mjs
CHANGED
|
@@ -80,6 +80,7 @@ let DRY_RUN = false;
|
|
|
80
80
|
let RUN_UPLOAD_LIST = false;
|
|
81
81
|
let RUN_DOWNLOAD_LIST = false;
|
|
82
82
|
let SKIP_SYNC = false;
|
|
83
|
+
let SIZE_ONLY = false;
|
|
83
84
|
let cliLogLevel = null;
|
|
84
85
|
let configPath = undefined;
|
|
85
86
|
|
|
@@ -92,6 +93,9 @@ for (let i = 0; i < rest.length; i += 1) {
|
|
|
92
93
|
case "--dry-run":
|
|
93
94
|
DRY_RUN = true;
|
|
94
95
|
break;
|
|
96
|
+
case "--size-only":
|
|
97
|
+
SIZE_ONLY = true;
|
|
98
|
+
break;
|
|
95
99
|
case "--sidecar-upload":
|
|
96
100
|
RUN_UPLOAD_LIST = true;
|
|
97
101
|
break;
|
|
@@ -196,4 +200,4 @@ main().catch((err) => {
|
|
|
196
200
|
console.error(err);
|
|
197
201
|
}
|
|
198
202
|
process.exit(1);
|
|
199
|
-
});
|
|
203
|
+
});
|