I've successfully restored a backup of a very large and deeply-nested directory. However, the newly restored files have timestamps from when they were restored, not when the originals were created, modified, etc. I'd like to just copy over the timestamps and other metadata to the new files without doing the whole restore again. How might I accomplish that?
I'm using OSX 10.11.6, and have linux/gnu tools installed through HomeBrew. I'm hoping there's a simple CLI command for this.
I also don't want the process to choke if there are files missing or added in the destination (which there may well be).
CLARIFICATION: The original files exist in a DMG disk image. I unpacked the whole directory from that image onto a portable hard drive using OSX Disk Utility, then [and this is where I lost the timestamps] I copied the unpacked directory onto my laptop with 'copy -R /Volumes/disk/source /destination'. I still have both of the original sources, but the unpacking/copying process took many, many hours, so I'm not eager to do it again.
UPDATE: Ok, it looks like what I need is a bash script that does something like this:
for each original_file in original_directory:
if destination_file with same name exists in destination_directory and equivalent subdirectory:
if destination_file timestamp is in a given range:
use touch command to give destination_file the timestamp of original_file