A command-line utility written in Go for scanning, copying, and organizing image and video files based on metadata (creation date), with optional checksum generation and source cleanup.
- Scan directories and generate MD5 checksums
- Read image or video creation timestamp metadata
- Organize copied files using configurable directory formats
- Recursive directory traversal
- Force copy and overwrite handling
- Optional removal of source files after copying
- Console logging and file logging (
custom.log) - High Performance: Partial hashing for large files and configurable concurrency
- Visual Feedback: Real-time progress spinner with current file status
| Format | Processing Method | Description |
|---|---|---|
mp4, mov, m4v, 3gp |
Metadata Parsing | Extracts creation date from atoms/boxes (e.g., mvhd). |
qt, 3g2, f4v, f4p, f4a, f4b |
Metadata Parsing | Extracts creation date from atoms/boxes. |
mpg, vob |
Header Parsing | Extracts timestamp from MPEG Program Stream packs. |
wmv, avi, mkv, webm |
File Modification Time | Uses filesystem ModTime as a fallback. |
flv, ts, mts, m2ts |
File Modification Time | Uses filesystem ModTime as a fallback. |
ogg, yuv, rm, rmvb, viv |
File Modification Time | Uses filesystem ModTime as a fallback. |
asf, amv, svi, mxf |
File Modification Time | Uses filesystem ModTime as a fallback. |
roq, nsv |
File Modification Time | Uses filesystem ModTime as a fallback. |
| Format | Processing Method | Description |
|---|---|---|
jpg, jpeg |
EXIF Parsing | Extracts Date/Time Original from EXIF data. |
tiff, tif |
EXIF Parsing | Extracts creation date from TIFF metadata. |
cr2, nef, arw, dng, orf, rw2, raf |
EXIF Parsing | Attempts to parse embedded EXIF; falls back to ModTime if failed. |
png, gif, bmp |
File Modification Time | Uses filesystem ModTime as a fallback. |
heic |
EXIF Parsing | Extracts EXIF from ISOBMFF metadata box. |
webp, svg, psd, ai |
File Modification Time | Uses filesystem ModTime as a fallback. |
cr3 |
File Modification Time | Uses fallback (CR3 structure is complex/ISOBMFF). |
- Go installed (compatible with this repository)
- macOS, Linux, or Windows
- Terminal or shell access
brew tap evijayan2/icopy
brew install icopy- Go to the Releases Page.
- Download the archive for your OS:
- Windows:
icopy-windows-amd64.zip - Linux:
icopy-linux-amd64.tar.gz
- Windows:
- Extract the archive.
- (Optional) Move the binary to a folder in your
PATH(e.g.,/usr/local/binon Linux).
Clone the repository:
git clone https://github.com/evijayan2/icopy.git
cd icopyDownload dependencies:
go mod tidyTo build the project locally, run:
make buildTo verify the installation:
make verifyTo create release binaries manually:
make releaseBinaries will be available in the build/ directory.
Run directly using Go:
go run main.go [options]Or using the compiled binary:
icopy [options]The following flags are defined exactly as implemented in main.go, including defaults and behavior.
| Flag | Type | Default | Description |
|---|---|---|---|
-scan |
bool | false |
Scan files and generate MD5 checksum files only |
-video |
bool | false |
Read video creation date metadata |
-image |
bool | false |
Read image creation date metadata |
-removesource |
bool | false |
Remove source files after successful copy |
-dirformat |
string | "NOF" |
Output directory format (DATE, YEAR-MONTH, NOF) |
-out |
string | "." |
Output directory |
-in |
string | "" |
Input directory (required) |
-recursive |
bool | false |
Recursively process subdirectories |
-force |
bool | false |
Force copy of files (overrides defaults) |
-overwrite |
string | "no" |
Overwrite existing files (yes, no, ask) |
-workers |
int | 10 |
Number of parallel worker threads |
-fast-hash |
bool | true |
Use partial hashing for large files (>50MB) |
- Exactly one of
-imageor-videoshould be enabled. - If
-inis not provided, the program exits with an error. - When
-scan=true, files are scanned and validated but not copied. -forceoverrides duplicate and conflict checks.-fast-hashsignificantly speeds up scanning large video files by hashing only the beginning, middle, and end.
- DATE – Organize files as
YYYY-MM-DD/ - YEAR-MONTH – Organize files as
YYYY-MM/ - NOF – No folder organization (default)
./icopy \
-scan=true \
-in=/path/to/media \
-out=/path/to/output./icopy \
-image=true \
-in=/path/to/photos \
-out=/backup/photos \
-dirformat=YEAR-MONTH \
-recursive=true./icopy \
-video=true \
-in=/path/to/videos \
-out=/backup/videos \
-dirformat=DATE \
-recursive=true \
-workers=20 \
-fast-hash=true./icopy \
-image=true \
-in=/path/to/media \
-out=/organized \
-recursive=true \
-removesource=trueWarning: Source files are permanently deleted after a successful copy.
./icopy \
-image=true \
-in=/src \
-out=/dest \
-force=true \
-overwrite=yes- Logs are written to the console
- A detailed log file is created as
custom.log - Errors, skipped files, and copied files are summarized
- Run with
-scan=truebefore copying large datasets - Avoid
-removesourceuntil results are verified - Use
YEAR-MONTHformat for large photo libraries - Redirect output to a file for auditing
./icopy ...options... > icopy.log 2>&1- Organizing phone or camera photos
- Backing up large video collections
- Cleaning and structuring legacy media archives
Refer to the repository for license information.