mc diff

The mc diff command computes the differences between two filesystem directories or MinIO AIStor buckets. mc diff lists the objects that are missing from one side, and the objects that differ in size or checksum. mc diff does not read the contents of objects.

Syntax

Parameters

SOURCE

Required The S3 bucket or filesystem folder to compare to the TARGET.

For a bucket on MinIO AIStor, specify the alias and the bucket. For example:

mc diff myaistor/mybucket/ ~/path/to/mydata/

For an object from a local filesystem, specify the full path to that bucket. For example:

mc diff ~/path/to/mydata/ myaistor/mybucket/

TARGET

Required The filesystem folder or S3 bucket to compare to the SOURCE.

For a bucket from MinIO AIStor, specify the alias and the bucket. For example:

mc diff myaistor/mybucket/ ~/path/to/mydata/

For an object from a local filesystem, specify the full path to that folder. For example:

mc diff ~/path/to/mydata/ myaistor/mybucket/

Global flags

This command supports any of the global flags.

Examples

The following example assumes that the myaistor alias exists. Replace myaistor with the alias for your preferred S3-compatible deployment.

mc diff myaistor/bucket1 play/bucket2

Behavior

Output legend

mc diff uses the following legend when formatting the diff output:

FIRST < SECOND - object exists only in FIRST
FIRST > SECOND - object exists only in SECOND
FIRST ! SECOND - a newer object exists in FIRST, or the objects differ in size or checksum

Checksum comparison

mc diff compares checksums when both sides report a checksum of the same algorithm. The comparison uses the checksums the server already reports, so mc diff still does not read object contents.

Equal checksums always mean equal content.

Unequal checksums mean the objects differ only when the checksum covers the whole object. A composite checksum is a hash of the individual part hashes, so it also changes when only the part layout changes. mc diff therefore does not report a difference from unequal composite checksums alone.

S3 compatibility

The mc command-line tool is built for compatibility with the AWS S3 API and is tested with MinIO AIStor and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported.

While mc commands may work as documented, any such usage is at your own risk.