Using sync on a Mac to compare the checksums of files on an external disk attached to my Mac with the files in a third part cloud service

I recently synced all of the data from a third party cloud drive service I used into a directory on an external drive attached to my Mac which holds the local data of my Google Drive.

The size of the cloud folders is less than that of the size of the data on the local drive. My AI program told me that’s because the cloud program reports the physical size whereas the local copy reports the logical size. This makes sense to me.

My AI suggested the following procedure to further compare the two sets of data. Before I proceed, I just want some feedback from others as to if my AI instructions are correct.


Using a tool called rsync is the most effective way to compare the two directories and verify their contents. rsync is a powerful command-line utility that comes pre-installed on macOS. It’s excellent for synchronizing files and, in this case, can be used to perform a dry run to report on any differences without actually changing any files.
Here is the command you can use in the Terminal to compare the directories:

  1. Open Terminal from your Applications/Utilities folder.
  2. Type the following command, but do not press Enter yet: rsync -rvn --size-only --checksum /path/to/your/external/drive/directory/ /path/to/your/cloud/directory/
    • -r: This flag ensures the command runs recursively, meaning it will check all subfolders within the main directory.
    • -v: This stands for verbose, which means it will print a list of files that are different or missing.
    • -n: This is a crucial flag for a dry run. It means the command will not make any changes. It will only report what it would have done.
    • –size-only: This option will skip checking the file modification times and just compare the file sizes.
    • –checksum: This is the most reliable method for verification. rsync will compute a checksum for each file in both directories and report on any files that have different checksums, even if their sizes are the same. This is the ultimate test for data integrity.
  3. Replace /path/to/your/external/drive/directory/ and /path/to/your/cloud/directory/ with the actual paths to your folders. A simple way to do this is to drag and drop the folders from Finder directly into the Terminal window. The Terminal will automatically fill in the correct path.
  4. Once the command is correct, press Enter.
    The rsync command will then scan both directories and print a list of any files that are missing or have a different size or checksum. If the output is a blank line, it means the directories are identical and the files match.

Would you like to know how to save the output of the rsync command to a text file so you can easily review the results later?

1 Like

rsync is similar to what i would suggest. but i wonder if you’ll get weird results from a cloud drive that might have some slight differences in terms of invisible mac dotfiles.

there’s no harm in a dryrun to see the output.

i wouldn’t run rsync (outside of dry mode) on the drives though. because cloud services do different things. they often keep revisions, or slight alternations