-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This project provides a set of powerful Bash scripts designed to organize and ensure the uniqueness of media files (images, videos, etc.) by renaming them with a structured, information-rich filename. This new filename acts as a custom "snowflake-like" identifier, containing data about the file’s origin and when it was processed.
A companion script is also provided to easily decode these filenames back into human-readable information.
-
rename_files.sh: The main script that recursively finds media files in a directory and renames them. It intelligently extracts the creation date from EXIF metadata and generates a unique ID to prevent filename collisions. -
decode_snowflake.sh: A utility script that takes a renamed file and displays its constituent parts in a clear, formatted way, explaining what each part of the "snowflake" ID means.
-
Information-Rich Filenames: Filenames aren’t just random strings; they contain the file’s creation date, a process timestamp, and a unique identifier.
-
Traceability: Know exactly when a file was processed and by what identifier.
-
Uniqueness: A combination of a timestamp and a random number virtually eliminates the chance of duplicate filenames, even when processing files in bulk.
-
Idempotent: The script is safe to run multiple times in the same directory. It automatically detects and skips files that have already been renamed.
-
Intelligent Date Detection: Prioritizes the original creation date from EXIF data (
DateTimeOriginal) and gracefully falls back to the file’s modification time if EXIF data is not available. -
Easy Verification: Use the
decode_snowflake.shscript to instantly verify the information embedded in any filename.
To get started, please explore the detailed guides for each component:
-
[rename_files.sh](https://github.com/marcelositr/FileRenamerAndSnowflakeDecoder/wiki/rename_files.sh)
-
[decode_snowflake.sh](https://github.com/marcelositr/FileRenamerAndSnowflakeDecoder/wiki/decode_snowflake.sh)
-
[The Filename Structure](https://github.com/marcelositr/FileRenamerAndSnowflakeDecoder/wiki/The-Filename-Structure)