Sample Header Ad - 728x90

Compare directories ignoring time differences of 1h +- 2s

1 vote
3 answers
548 views
I often want to synchronize my Music folders between my Android mobile phone and my Linux PC. The files on my phone are stored on an SD card using FAT32 and can come from either my Windows laptop or my Linux desktop PC. I want to compare only metadata, otherwise it takes ages to compare contents. When I use Meld or rsync to find differences, I get a lot of false positives caused by the fact that FAT32 stores file times with 2-second resolution and local time (UK time), whereas on Linux file modification times are stored with sub-second resolution and UTC. So when I am looking at a file copied to SD card during winter and now it's summer, or vice versa, I can see a time difference of exactly 1 hour (with 2-second precision). Is there a tool that will scan the folders and consider the file times to be the same if they differ by 2 seconds OR by between 59m58s and 1h00m02s ?
Asked by DodgyCodeException (113 rep)
Apr 3, 2023, 01:13 PM
Last activity: Apr 3, 2023, 06:27 PM