rclone/fs/operations
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
..
operationsflags sync: report list of synced paths to file -- see #7282 2024-01-20 14:50:08 -05:00
check_test.go operations: skip backends incapable of testing TestApplyTransforms - #7591 2024-02-13 15:07:41 -05:00
check.go vfs: fix unicode normalization on macOS - fixes #7072 2024-03-06 16:12:13 +00:00
copy_test.go operations: fix invalid UTF-8 when truncating file names when not using --inplace 2023-10-29 14:04:37 +00:00
copy.go rc: add srcFs and dstFs to core/stats and core/transferred stats 2024-02-02 11:43:10 +00:00
dedupe_test.go test: replace defer cleanup with t.Cleanup 2022-12-09 14:38:05 +00:00
dedupe.go accounting: Make checkers show what they are doing 2023-03-01 11:10:38 +00:00
listdirsorted_test.go test: replace defer cleanup with t.Cleanup 2022-12-09 14:38:05 +00:00
logger.go sync: report list of synced paths to file -- see #7282 2024-01-20 14:50:08 -05:00
lsjson_test.go lsjson,lsf: make sure metadata appears for directories 2024-02-28 16:26:14 +00:00
lsjson.go lsjson,lsf: make sure metadata appears for directories 2024-02-28 16:26:14 +00:00
multithread_test.go rc: add srcFs and dstFs to core/stats and core/transferred stats 2024-02-02 11:43:10 +00:00
multithread.go operations: use built in io.OffsetWriter for go1.20 2024-01-15 16:22:07 +00:00
operations_internal_test.go fs: deglobalise the config #4685 2020-11-26 16:40:12 +00:00
operations_test.go sync: don't set dir modtimes if already set 2024-03-07 09:57:11 +00:00
operations.go sync: don't set dir modtimes if already set 2024-03-07 09:57:11 +00:00
rc_test.go operations: add operations/hashsum to the rc as rclone hashsum equivalent 2024-02-29 16:21:42 +00:00
rc.go operations: add operations/hashsum to the rc as rclone hashsum equivalent 2024-02-29 16:21:42 +00:00
reopen_test.go operations: make Open() return an io.ReadSeekCloser #7350 2023-11-20 18:07:05 +00:00
reopen.go operations: make Open() return an io.ReadSeekCloser #7350 2023-11-20 18:07:05 +00:00