cksgen/README.md

37 lines
2.0 KiB
Markdown
Raw Permalink Normal View History

2023-08-01 00:07:14 +02:00
# cksgen – Generate and compare MD5 checksum lists with Python
This little command line program written in Python is an advanced port of my [PowerShell script](https://code.helmutkaczmarek.de/helmut/cksgen-ps) for ensuring the data integrity of my photo archive. It identifies corrupted `.jpg`, `.jpeg`, `.dng` and `.cr2` files by generating lists of determined MD5 checksums and comparing them to previous checks. Of course, cksgen can also be used for any other types of files.
This program is primarily intended for archived data stocks that no longer change. Of course, you can also use it for data that is being edited from time to time. In this case, one must not forget that the MD5 checksums already change if, for example, the metadata of a JPG file is edited. So the message `ATTENTION: Different MD5 checksums found` on the command prompt does not necessarily indicate a corrupted file.
## Features
* Determines the MD5 checksums of files and writes them to the file `yyyyMMdd_HHmmss_checksum.txt`.
* Compares the checksums of the last two checksum files and outputs a corresponding message in the command prompt and in the log file `yyyyMMdd_HHmmss_log.txt`.
* Allowed file extensions can be specified.
* The number of checksum files and log files to be kept can be specified.
* The form of the time stamp in the file name of the log files and checksum files can be adjusted.
* The folder names for the log files and checksum files can also be specified.
* The command prompt will let you know which file is being processed.
# Usage
General Usage:
`cksgen [-h] [-c CONFIG] [-e]`
If you haven't compiled the cksgen.py file into an executable file (e.g. **cksgen.exe** on a Windows system; you can do so with `pyinstaller --onefile cksgen.py`) and haven't registered it in the system environment variables, then:
`python /path/to/cksgen.py [-h] [-c CONFIG] [-e]`
Help:
`cksgen -h`
See example configuration file:
`cksgen -e`
Example usage with a configuration file **photos.conf**:
`cksgen -c photos`