Copying folder timestamps

I recently collected all my backups to try and organize all my old files. To my horror, the original timestamps on all the folders have been lost :open_mouth:. Is it possible to traverse the folder tree and set the timestamp in a folder to the newest timestamp of any subfile/subfolder?

Opus can preserve folder timestamps when copying files (as long as it is folders created in the process; existing folder timestamps won't be copied over), depending on configuration and also support on the target filesystem (some NAS devices don't support it).

Copying timestamps from one existing directory structure to another isn't something Opus can do out of the box, although a script could be written to do so. I would advise against it, however.

Folder timestamps are very fragile and get changed if any file or folder is created, removed or renamed (and perhaps other operations) below the folder. They can be useful as rough guides to when a folder (but not necessarily the data within it) was last modified, but only as very rough guides.

So before worrying about folder timestamps, I strongly urge you to rethink whatever you have in mind which has led to wanting to preserve them; it is probably not a good idea, even though Opus will let you do it.

A better solution might be to use a column which really reports the newest timestamp of any subfile/folder, without the folder timestamps mattering. There are two scripts which add columns for that:

Custom Column - Newest File (this is the more simple one)

Custom Columns: Newest/Oldest filedate columns w/filtering (more complex one which lets you filter which files are considered)

Thank you, leo, for a good reply!

The pinch I am in is that I have made backups of backups of backups for over 20 years without getting around to going through everything and making a tidy system. I have a lot of old folders that are almost identical but where some files are modified or have additional files that might be important to save. Having the original timestamps on my old folders would help me a lot.

But I think those scripts can help me actually. I will check them out!

Cheers!

Jostein,

Sorry to inject myself into this thread, but I'm one of the few folks who also like to keep my directory timestamps intact as much as possible. Opus will preserve them when copying directories, which is one of the many many many reasons I use Opus...

But now that you've lost your timestamps, there is a very simple way to restore them if you have an unpolluted master copy (i.e., if the timestamps on either your backup target or your source are still intact).

The Windows ROBOCOPY command will fix your timestamps. I use the /MIR switch to mirror one drive (or directory) to another, which I how I do backups. If you include the /TIMFIX switch, the program will not only mirror all your files/folders, but will reset the timestamps to match as well. So, make sure your source and target folders are identical, then run ROBOCOPY with the /MIR /TIMFIX switches (and anything else you need) to copy the "good timestamped" folder tree(s) to the "bad timestamped" folder tree(s), and when it's done your folder structures and file/folder timestamps will be perfectly mirrored.