rclone / rclone/rclone

iClouddrive: source ModTime is detected correctly but not preserved when copying to CIFS filesystem

Open
#9,807 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
59.9k
Forks
5.4k
Avg merge
2d 14h
Merged PRs (30d)
48

Description

Before you start
  • I have searched the forum and the existing issues for this problem.
  • I have tested with the latest beta or stable release and can still reproduce the problem.
  • This is a reproducible bug, not a usage question (questions belong on the forum).
Associated forum post URL

No response

What is the problem you are having with rclone?

When copying files from the iClouddrive backend to a CIFS-mounted filesystem, rclone correctly detects the source modification time, but the modification time is not preserved on the destination file.

This causes subsequent copy/sync runs to see the destination file as having a different modification time and may result in unchanged files being transferred again unnecessarily.

The problem can be reproduced with a single HEIC file.

Source file:

iCloud:Projects/Cocina/Fotos/20260606 Fregadero 80/IMG_0751.HEIC

SOURCE MODTIME

The iClouddrive backend reports the correct modification time for the source file.

Command:

cd /docker/rclone && sudo docker compose run --rm rclone lsjson "iCloud:Projects/Cocina/Fotos/20260606 Fregadero 80/IMG_0751.HEIC" --stat

Output:

{
"Path": "IMG_0751.HEIC",
"Name": "IMG_0751.HEIC",
"Size": 2413551,
"MimeType": "application/octet-stream",
"ModTime": "2026-06-06T12:18:57Z",
"IsDir": false
}

Therefore the iClouddrive backend provides rclone with the correct source ModTime:

2026-06-06 12:18:57 UTC

DESTINATION FILESYSTEM

The destination is a CIFS-mounted filesystem on the host:

/mnt/alldata

Mount information:

//192.168.0.3/alldata on /mnt/alldata type cifs
(rw,relatime,vers=3.0,sec=ntlmssp,cache=strict,...)

I verified separately that the modification time CAN be changed manually through this CIFS mount.

For example, setting the modification time of the test file manually to 2026-06-06 12:18:57 works correctly.

Therefore the CIFS filesystem itself supports changing the modification time.

RCLONE COPY TEST

The problem was reproduced using the rclone development binary directly on the host, rather than running the copy inside the Docker container.

Command:

sudo /docker/rclone/pr9487/rclone copyto "iCloud:Projects/Cocina/Fotos/20260606 Fregadero 80/IMG_0751.HEIC" "/mnt/alldata/iCloud/IMG_0751-host-test.HEIC" --config /docker/rclone/config/rclone.conf --ignore-size -vv

The transfer completed successfully:

IMG_0751.HEIC: Copied (new) to: IMG_0751-host-test.HEIC

Transferred: 2.302 MiB / 2.302 MiB, 100%
Transferred: 1 / 1, 100%

DESTINATION MODTIME

After the transfer, stat on the destination file shows:

File: /mnt/alldata/iCloud/IMG_0751-host-test.HEIC
Size: 2413551
Access: 2026-08-22 13:15:06.831031000 +0200
Modify: 2026-08-22 09:34:13.801947300 +0200
Change: 2026-08-22 09:34:13.801947300 +0200
Birth: 2026-08-22 09:34:13.000000000 +0200

The important value is:

Modify: 2026-08-22 09:34:13

This corresponds to the time of the rclone transfer.

It does NOT correspond to the source modification time:

2026-06-06 12:18:57 UTC

EXPECTED RESULT

After the copy, the destination file should have the source modification time:

2026-06-06 12:18:57 UTC

ACTUAL RESULT

The destination file has the timestamp of the transfer:

2026-08-22 09:34:13

SUMMARY

  1. The iClouddrive backend reports the correct source ModTime.
  2. The CIFS filesystem supports manually setting the modification time.
  3. rclone successfully transfers the file.
  4. The resulting destination file nevertheless keeps the transfer time as its modification time.
  5. The behavior was reproduced with the rclone development binary running directly on the host, so the Docker container itself is not involved in the destination filesystem access.

This ModTime mismatch can cause subsequent copy/sync runs to unnecessarily transfer unchanged files again.

rclone version

rclone v1.75.0-DEV

  • os/version: raspbian 13.6 (64 bit)
  • os/kernel: 6.18.34+rpt-rpi-v8 (aarch64)
  • os/type: linux
  • os/arch: arm64 (ARMv8 compatible)
  • go/version: go1.25.0
  • go/linking: static
  • go/tags: none
Operating system

Linux

Which cloud storage system are you using?

Drive

Output of rclone config redacted
[iCloud]
type = iclouddrive
apple_id = XXX
password = XXX
_auth_session =
cookies = XXX
trust_token = XXX
The command you were trying to run
sudo /docker/rclone/pr9487/rclone copyto "iCloud:Projects/Cocina/Fotos/20260606 Fregadero 80/IMG_0751.HEIC" "/mnt/alldata/iCloud/IMG_0751-host-test.HEIC" --config /docker/rclone/config/rclone.conf --ignore-size -vv
A log from the command with the -vv flag
2026/08/22 09:33:50 DEBUG : rclone: Version "v1.75.0-DEV" starting with parameters ["/docker/rclone/pr9487/rclone" "copyto" "iCloud:Projects/Cocina/Fotos/20260606 Fregadero 80/IMG_0751.HEIC" "/mnt/alldata/iCloud/IMG_0751-host-test.HEIC" "--config" "/docker/rclone/config/rclone.conf" "--ignore-size" "-vv" "--log-file=/tmp/rclone-modtime.log"]
2026/08/22 09:33:50 DEBUG : Creating backend with remote "iCloud:Projects/Cocina/Fotos/20260606 Fregadero 80/IMG_0751.HEIC"
2026/08/22 09:33:50 DEBUG : Using config file from "/docker/rclone/config/rclone.conf"
2026/08/22 09:33:50 DEBUG : iclouddrive: reusing session with cached endpoints
2026/08/22 09:34:07 DEBUG : fs cache: renaming child cache item "iCloud:Projects/Cocina/Fotos/20260606 Fregadero 80/IMG_0751.HEIC" to be canonical for parent "iCloud:Projects/Cocina/Fotos/20260606 Fregadero 80"
2026/08/22 09:34:07 DEBUG : Creating backend with remote "/mnt/alldata/iCloud/"
2026/08/22 09:34:07 DEBUG : fs cache: renaming cache item "/mnt/alldata/iCloud/" to be canonical "/mnt/alldata/iCloud"
2026/08/22 09:34:10 DEBUG : IMG_0751.HEIC: Need to transfer - File not found at Destination
2026/08/22 09:34:13 DEBUG : IMG_0751-host-test.HEIC.cf2747c0.partial: renamed to: IMG_0751-host-test.HEIC
2026/08/22 09:34:13 INFO  : IMG_0751.HEIC: Copied (new) to: IMG_0751-host-test.HEIC
2026/08/22 09:34:13 INFO  :
Transferred:        2.302 MiB / 2.302 MiB, 100%, 0 B/s, ETA -
Transferred:            1 / 1, 100%
Elapsed time:         3.3s

2026/08/22 09:34:13 DEBUG : 9 go routines active
Anything else?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the single-file copy with the iCloud source, the CIFS-mounted destination, and the provided rclone command, then inspect the iClouddrive and local filesystem backends involved in the transfer. The fix is complete when the destination preserves the source ModTime and subsequent copy or sync runs do not transfer the unchanged file again.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.