Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect change of timestamp to file with same content #12

Open
perseas12 opened this issue Jun 22, 2024 · 0 comments
Open

Incorrect change of timestamp to file with same content #12

perseas12 opened this issue Jun 22, 2024 · 0 comments

Comments

@perseas12
Copy link

$ rsync-sidekick --version
v1.5.0

Create this file structure:

  1. file-1 has the same content and modification timestamp in the source and destination directories.
  2. file-2 has different content and modification timestamp in the source and destination directories.
  3. file-1 has the same content as file-2 in the source directory.
$ mkdir source destination
$ echo "a" > source/file-1
$ cp --archive source/file-1 destination/
$ echo "b" > destination/file-2
$ echo "a" > source/file-2
$ stat --format "%n  %y" source/* destination/*
source/file-1       18:30:26
source/file-2       18:30:39
destination/file-1  18:30:26
destination/file-2  18:30:35
$ cat source/file-1 source/file-2 destination/file-1 destination/file-2
a
a
a
b

rsync-sidekick incorrectly propagates the modification timestamp of source file-2 to destination file-1. Because of this, rsync copies file-1 from source to destination, because the timestamps are different:

$ rsync-sidekick source/ destination/
Found 1 actions that can save you 2 B of files transfer!
Applying sync actions at destination...
   1/1 propagate timestamp of "source/file-2" to "file-1":
done
$ rsync -av source/ destination/
./
file-1
file-2

rsync-sidekick must not do anything, so that rsync does not copy file-1:

$ mkdir source destination
$ echo "a" > source/file-1
$ cp --archive source/file-1 destination/
$ echo "b" > destination/file-2
$ echo "a" > source/file-2
$ rsync -av source/ destination/
./
file-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant