Please confirm modfication dates are not preserved for directories

What is the problem you are having with rclone?

I am using rclone to sync files from large Google Shared Drives to MS OneDrive. After a sync I confirm that file modification times are preserved on the files that have been synced, but all the enclosing directories are dated today.

I've looked at a few other posts to this forum, and see that others have had the same question, but some of the answers seem specific to the cloud storage (or local mount conditions), and I just want to confirm that there is no way to preserve dates on enclosing directories before I proceed with my transfers.

Thanks for your help!

Run the command 'rclone version' and share the full output of the command.

Yes.

Which cloud storage system are you using? (eg Google Drive)

My source is Google Shared Drive.
My destination is MS OneDrive.

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone sync --progress NSIDC-SD-modice-for-sota: OneDrive-CHARIS:modice-for-sota

The rclone config contents with secrets removed.

$ rclone config
Current remotes:

Name                 Type
====                 ====
NSIDC-SD-modice-for-sota drive
OneDrive-CHARIS      onedrive


A log from the command with the -vv flag

(Not sure this is needed--it's a lot of output. Let me know if it's needed.)

hello and welcome to the forum,

confirmed, rclone preserves modtimes of files, not directories.

https://github.com/rclone/rclone/issues/1669

Thanks that is helpful. It looks like the link you included may be indicating that a feature for this behavior may be planned (but sounds nontrivial). I have been given until July of this year to do my transfers. Is there any chance the feature may be ready in this time frame, so if I procrastinate, I may be able to take advantage of the implementation?

well,

you are always welcome to implement the feature.

or given the complexity of the feature request,
can sponsor the primary rclone author to implement it.

Modification dates of directories aren't usually very important. Why do you need them?

It’s simple provenance. The content of these directories is the record of research projects that can have spanned many years, with multiple people involved over that span of time. When looking at a given directory and seeing modification times, I or a colleague would be able to identify the time period on the project when that directory was last accessed. With the directory dates gone, the task will require traversing down to file levels, and/or puzzling out differences using directory names that may or may not have enough information in them.

Ah, I see. I tend to ignore directory modification times as any little thing happening in the directory changes it (for example writing MD5SUM files), but I take your point.

Rclone knows the modification times of directories, it just doesn't attempt to sync them. It is a bit of a minefield for a syncing program, because the act of writing files into directories changes their modification times (or can do depending on the destination backend), so the directory modification times need to be set at the end of the sync and the deepest first to shallowest.

It would be possible to list the directory times on the source and set them using another tool.

That sounds like a timing nightmare for a large sync. The funding for these particular projects is finished, so I'm inclined to just make the contents of the archive safe and be done with it, but it's good to know that it could be done. Thank you for asking about it and explaining the general approach that would be needed.

What you could do is use something like this to make a report of all the directory dates and save it in the archive.

rclone lsf -R --dirs-only -Fpt --csv src:

(Above is untested - not at computer!)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.