rclone/fs/sync
nielash 8c69455c37 sync: don't set dir modtimes if already set
Before this change, directory modtimes (and metadata) were always synced from
src to dst, even if already in sync (i.e. their modtimes already matched.) This
potentially required excessive API calls, made logs noisy, and was potentially
problematic for backends that create "versions" or otherwise log activity
updates when modtime/metadata is updated.

After this change, a new DirsEqual function is added to check whether dirs are
equal based on a number of factors such as ModifyWindow and sync flags in use.
If the dirs are equal, the modtime/metadata update is skipped.

For backends that require setDirModTimeAfter, the "after" sync is performed only
for dirs that could have been changed by the sync (i.e. dirs containing files
that were created/updated.)

Note that dir metadata (other than modtime) is not currently considered by
DirsEqual, consistent with how object metadata is synced (only when objects are
unequal for reasons other than metadata).

To sync dir modtimes and metadata unconditionally (the previous behavior), use
--ignore-times.
2024-03-07 09:57:11 +00:00
..
pipe_test.go fs: use atomic types 2023-08-22 12:52:13 +01:00
pipe.go move: if --check-first and --order-by are set then delete with perfect ordering 2023-03-10 08:23:32 +00:00
rc_test.go test: replace defer cleanup with t.Cleanup 2022-12-09 14:38:05 +00:00
rc.go docs: cross link doc pages for related commands 2022-06-21 23:43:00 +02:00
sync_test.go sync: don't set dir modtimes if already set 2024-03-07 09:57:11 +00:00
sync.go sync: don't set dir modtimes if already set 2024-03-07 09:57:11 +00:00