From 022dec7aba633f8b4e40339d555cc7cae5399314 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sun, 16 Mar 2008 17:50:28 -0700 Subject: [PATCH] Moved the --append check so that files that don't need to be transferred still get their non-content attributes updated, and combining --append with --hard-links will not prevent the discovery of unchanged files. --- generator.c | 7 ++++--- rsync.yo | 9 ++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/generator.c b/generator.c index 909c0f4d..e189dddd 100644 --- a/generator.c +++ b/generator.c @@ -1743,9 +1743,6 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, goto cleanup; } - if (append_mode > 0 && sx.st.st_size >= F_LENGTH(file)) - goto cleanup; - if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH) ; else if (fnamecmp_type == FNAMECMP_FUZZY) @@ -1770,6 +1767,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, goto cleanup; } + if (append_mode > 0 && sx.st.st_size >= F_LENGTH(file)) { + goto cleanup; + } + prepare_to_open: if (partialptr) { sx.st = partial_st; diff --git a/rsync.yo b/rsync.yo index 9c996452..6bbf400c 100644 --- a/rsync.yo +++ b/rsync.yo @@ -723,9 +723,12 @@ receiving user. dit(bf(--append)) This causes rsync to update a file by appending data onto the end of the file, which presumes that the data that already exists on the receiving side is identical with the start of the file on the sending -side. Any files that are the same size or longer on the receiving side -are skipped. Files that do not yet exist on the receiving side are -transferred, regardless of size. Implies bf(--inplace), +side. If a file needs to be transferred and its size on the receiver is +the same or longer than the size on the sender, the file is skipped. This +does not interfere with the updating of a file's non-content attributes +(e.g. permissions, ownership, etc.) when the file does not need to be +transferred, nor does it affect the updating of any non-regular files. +Implies bf(--inplace), but does not conflict with bf(--sparse) (since it is always extending a file's length). -- 2.34.1