IntegrityChecker java (icj): sync command
Available in version 2.0.4 or later.
The sync command syncs hash info to files in specified folders via the com.diglloyd.icj.HashInfo extended attribute. It does not perform hashing; it uses existing hash information.Always update prior to a sync because only up-to-date hash info will be synced.
Any number and combination of volumes or folders can be specified in a single invocation.
Files with stale hash info will not have the attribute added or updated; icj update required. Only files using the current SHA512 hashing algorithm will have the attribute added (do an update first).
The com.diglloyd.icj.HashInfo attribute ends with #S, which instructs programs to maintain it across backups and copies.
About extended attributes
Extended attributes (xattr) with hash info can be optionally stored with files as the com.diglloyd.icj.HashInfo. The contents is identical to the entry found in icjh files (hierarchy files). Such attributes are redundant, but useful if files or folders are moved around and their hash info “lost” relative to the hierarchy file. Attributes also make it possible to locate missing files in new locations.
Caveats: adding extended attributes may cause Time Machine to backup files all over again (TBD), even though the attribute is metadata and not stored as part of the file. Similarly but in the opposite sense, cloning may fail to copy extended attributes added after the initial clone, if the file has not otherwise changed.
Extended attributes are suitable only as a fallback/adjunct mechanism to icj hierarchy files. Limitations of extended attributes abound:
- Locked and read-only files cannot have the attribute added.
- Files that are otherwise readable and thus hashable by icj might not be writeable and thus cannot support attributes.
- Some file systems do not support extended attributes at all eg FAT32 (which can be in use on macOS also), some network servers, cloud servers (though iCloud supports them).
- Some backup programs do not copy extended attributes or offer an option to not copy them. (macOS Finder and programs like Carbon Copy Cloner do copy them by default).
- Windows systems lack extended attributes, or at least lack them in any way icj can manipulate them.
icj sync [<path>]*
Lines starting with "#" are comments.
# Sync attributes for all files in current directory, recursively
icj sync --sync=all
# Sync existing attributes in files in current directory, recursively
# Sync existing attributes for files in current directory, recursively, prompt for whether to save after listing info
icj sync --save=prompt
# Sync existing attributes for files in Folder1, Folder2, Folder3, recursively
icj sync Folder1 Folder2 Folder3
# Sync attributes for all files in Folder1, Folder2, Folder3, recursively
icj sync --sync=all Folder1 Folder2 Folder3
Copyright © 2008-2010 diglloyd Inc, all rights reserved