diff options
| author | tv <tv@krebsco.de> | 2026-11-13 20:33:24 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-13 22:00:50 +0100 |
| commit | a39ddee552a3955d1655fe89620daa31d9875d16 (patch) | |
| tree | c1d7302ab595e6f83354d6485d6d79cc76be11f9 | |
| parent | cc12e29147939aab27d44c8bd41ac7fde190e6af (diff) | |
populate: give sizes in rsync's log in units of 1024
rsync gives sizes in units of 1000 for two apostrophes, and in units of
1024 for three, which the shell implementation asks for. rsync-units
checks it.
| -rw-r--r-- | pkgs/populate/docs/design.md | 3 | ||||
| -rw-r--r-- | pkgs/populate/src/rsync.rs | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/pkgs/populate/docs/design.md b/pkgs/populate/docs/design.md index 7e68fdb..89bf581 100644 --- a/pkgs/populate/docs/design.md +++ b/pkgs/populate/docs/design.md @@ -120,7 +120,8 @@ replacing the Git work tree 'host:/var/src/x', because ... A target path in a message starts with `user@host:` for remote targets, without `user@` if the user is root or not set, and is a plain path for the local target. Errors start with `error:` or `krops:`, warnings with -`warning:`. rsync's itemized changes appear as `%i %n%L %b/%l`. +`warning:`. rsync's itemized changes appear as `%i %n%L %'''b/%'''l`, with sizes in +units of 1024. ## Safety diff --git a/pkgs/populate/src/rsync.rs b/pkgs/populate/src/rsync.rs index dd61b03..78022ab 100644 --- a/pkgs/populate/src/rsync.rs +++ b/pkgs/populate/src/rsync.rs @@ -108,10 +108,11 @@ pub fn transfer(context: &Context, config: &Config, source_path: &str, path: &st command.arg("--insecure-links"); } // Each item gets logged with what changed about it, and its size, as - // transferred and in total. + // transferred and in total, in units of 1024, which three apostrophes + // ask for. command .arg("--itemize-changes") - .arg("--out-format=%i %n%L %''b/%''l") + .arg("--out-format=%i %n%L %'''b/%'''l") .arg("--info=backup,del,copy,misc,mount,name,nonreg,remove,skip,symsafe") // Nothing relies on the times of directories and symlinks, and // keeping them would log a line for each directory changed. |
