Skip to content

Commit

Permalink
Moved the --append check so that files that don't need to be transferred
Browse files Browse the repository at this point in the history
still get their non-content attributes updated, and combining --append
with --hard-links will not prevent the discovery of unchanged files.
  • Loading branch information
Wayne Davison committed Mar 17, 2008
1 parent ddaef70 commit 022dec7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down
9 changes: 6 additions & 3 deletions rsync.yo
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down

0 comments on commit 022dec7

Please sign in to comment.