This shell script scans a directory for Microsoft Access database files (.mdb and .accdb), determines their JET version using mdb-ver from mdbtools, and outputs a table with the file name, JET version, and migration status.
- Searches for
.mdband.accdbfiles in a directory - Optional recursive mode to scan subdirectories (see Options)
- Uses
mdb-verto detect the JET engine version - Outputs a formatted table with:
- File name
- JET version
- Migration status (
OK,MDBTOOLS, orUnsupported)
- In recursive mode results are grouped by directory
- Bash (Linux/macOS/WSL)
mdbtoolspackage (formdb-ver)
Use your system package manager to install mdbtools. Common commands:
| Platform / Package manager | Install command |
|---|---|
| Debian / Ubuntu | sudo apt-get install mdbtools |
| RHEL / CentOS (EPEL) | sudo yum install epel-release && sudo yum install mdbtools |
| Fedora | sudo dnf install mdbtools |
| Arch Linux | sudo pacman -S mdbtools |
| openSUSE | sudo zypper install mdbtools |
| Alpine | sudo apk add mdbtools |
If your distribution doesn't package mdbtools, consider building from source (mdbtools GitHub) or using a prebuilt binary.
Make the script executable:
chmod +x mdbcheck.sh./mdbcheck.sh [options] [DIR]
If DIR is not specified, the current directory is used. Examples:
- Non-recursive (default):
./mdbcheck.sh /path/to/dir - Recursive:
./mdbcheck.sh -r /path/to/diror./mdbcheck.sh --recursive /path/to/dir
-r,--recursive— scan subdirectories recursively and group output by directory-c,--csv [file.csv]— write results to a CSV file (default:mdbcheck.csv) and also print the normal table output to the screen. If a filename is provided it must end with.csv; if the token after-cdoes not end with.csvit is treated as theDIRargument.-C,--csvonly [file.csv]— write results to a CSV file only (no table output); the script will show a progress dot for each file processed. The optional filename rules are the same as-c.-h,--help— show usage information
Default behavior is non-recursive (only top-level files in DIR).
- CSV header:
Path,File,JETVersion,Status.Pathis the full absolute path to the file (no shortening).Fileis the basename of the file.JETVersionis the JET engine label (no space in the header).Statusis one ofOK,MDBTOOLS, orUnsupported.
-cwrites the CSV file and still prints the normal table on-screen.-Cwrites only the CSV file and prints progress dots to indicate progress.
- In non-recursive mode the script prints the scanned directory as a single header line above the file list.
- In recursive mode the script prints a directory header when files from that directory are first encountered. This avoids repeating the directory name for every file.
- Directory headers are displayed using the full absolute path, but are abbreviated if too long to fit the File column. The abbreviation keeps the first two and last two path components and replaces the middle components with
.... If that abbreviation is still too long, a balanced truncation with...in the middle is used.
File JET Version Status
---------------------------------------- ---------- ------------
/absolute/path/to/scanned/dir
sample_access97_db.mdb JET4 OK
sample_access95_db.mdb JET3 MDBTOOLS
/absolute/path/to/scanned/dir/subdir1
sample2.mdb Error Unsupported
- OK: JET4 or greater (ready for migration)
- MDBTOOLS: JET3 (use mdbtools table extraction to convert for migration)
- Unsupported: Error or unknown version
- The script uses
mdb-verfrommdbtools. If it is not installed, the script will exit with an error.
MIT