1

I'm using exifautotran to automatically reorient images imported from a camera. This script uses jpegtran to do the rotations, and this utility is not able to modify the original file. I need to preserve the mtime because I'm then matching the media to missions completed in our app based on the timestamp.

Basically I just need to access the mtime from one file and assign it to another

How can I do this in a Mac UNIX terminal?

Robert Carter Mills
  • 793
  • 1
  • 9
  • 19

1 Answers1

2

Use touch with the -r flag to set timestamps relative to another file. Use -m to change only the mtime.

touch -m -r /path/to/old/file /path/to/new/file

ThatOneDude
  • 1,516
  • 17
  • 20