Synchronizing Object Storage Objects
Synchronize a file system directory with Object Storage objects in a bucket.
Synchronization traverses the directories and sub-directories of the specified file system, and copies new and changed objects from the source to the destination, and optionally deleting those that aren't present in the source.
Synchronizing Object Storage objects is only available using the CLI.
Using the CLI
Use the oci os object sync command and required parameters to synchronize the objects in a file system and a bucket:
oci os object sync --bucket-name bucket_name [OPTIONS]
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Verifying Uploaded Object Integrity
An MD5 checksum is computed for each uploaded object or for each part of a multipart object, which helps ensure that the object stored is the object that was uploaded. There's no automatic verify checksum option when running a synchronization (os object sync
).
A cryptographic hash using MD5 is provided for all objects uploaded to an Object Storage bucket using the synchronization method. This hash verifies the object's data integrity. Object Storage provides the object hash value in base64 encoding.
The MD5 hash is listed in the details of the object as the Content MD5 Hash or opc-multipart-md5 value. See Getting Object Details for more information.
Run the following command to covert the base64 encoded hash value to hexadecimal,
python -c 'print "BASE64-ENCODED-MD5-VALUE".decode("base64").encode("hex")'
For example:
python -c 'print "EoN8s6dgT/9pGYA7Yx1klQ==".decode("base64").encode("hex")'
12837cb3a7604fff6919803b631d6495
Now generate the md5sum
from the source file and verify both values match:
md5sum file_name
For example:
md5sum file_1.txt
12837cb3a7604fff6919803b631d6495 file_1.txt
Verifying Multipart Uploaded Objects
You can use preconfigured scripts available on GitHub to verify the MD5 checksum for multpart uploads to your Object Storage bucket. We recommend you use the part-size
parameter to simplify calculating the MD5 checksum. For more information and links to these scripts, see Support opc-multipart-md5 checking on GitHub.