On 2023-07-18 03:06, Robert Webb via openSUSE Users wrote:
On Mon, 17 Jul 2023 13:24:23 +0200, "jdd@dodin.org" <jdd@dodin.org> wrote:
Le 17/07/2023 à 13:10, Andrei Borzenkov a écrit :
On Mon, Jul 17, 2023 at 1:59 PM jdd@dodin.org <jdd@dodin.org> wrote: ...
jdd@localhost:~> rsync -rvv --delete -e ssh --exclude .dtrash
...
but why the Fichier.txt file is listed when it din't change?
I ran a test using the same filenames as yours, and with the '-i' (--itemize-changes) rsync option to show more info. Created a 'b' hierarchy the same as 'a', except for the one file:
Interesting. -i.
$ mkdir -p a/pwg_representative $ touch a/{08-ladygaga.mp4,pwg_representative/20140721-col-auterive-rex-08-ladygaga.jpg} $ cp -aT a b $ touch a/'Fichier texte.txt'
$ rsync -r -ivv --delete -e ssh -- a/ b/ sending incremental file list delta-transmission disabled for local transfer or --whole-file .d ./ .f 08-ladygaga.mp4 >f+++++++++ Fichier texte.txt .d pwg_representative/ .f pwg_representative/20140721-col-auterive-rex-08-ladygaga.jpg total: matches=0 hash_hits=0 false_alarms=0 data=0
sent 279 bytes received 119 bytes 796.00 bytes/sec total size is 0 speedup is 0.00
A second identical rsync run produces the same output except for this line:
>f..T...... Fichier texte.txt
What the characters in the coded string mean: . not being updated (besides attributes) + the file is newly created > a file is being transferred to [ b ] f it's a file d it's a directory
T the modification time will be set to the transfer time, which happens when a file/symlink/device is updated without --times and when a symlink is changed and the receiver can't set its time.
So, the file 'Fichier texte.txt' is "transferred" (no data) because its modification time in the destination does not match that in the source. And that is because you used the '-r' (--recursive) option instead of '-a' (--archive, equivalent to -rlptgoD), which everybody else uses (already suggested by Masaru). You got that from stackexchange?
I must be low on morning tea. Why...? (I also use -a)
Shame on them! :-)
Along with the '-a' option, '-H' is good to preserve hard links. Sometimes you may also want '-AX' to preserve ACLs and extended attributes. I always use '-i', instead of '-v', to see what's going on.
Forget rsync, though: [1]
[1] The Rolling Stones - Gimme Shelter (with Lady Gaga) https://www.youtube.com/watch?v=Gd0YcFWlvOc
-- Robert Webb
-- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)