Usage
Basic Conversion
To convert all RAR files under a directory:
wj-rar2zip /path/to/archives
This recursively scans the directory for .rar files and converts each one
to a .zip file in the same location. Progress is shown for each file:
[1/42] Storage/Harold The Cat.rar... done.
[2/42] Storage/Finances 1999.rar... done.
...
Converted 42 of 42 file(s).
Dry Run
To preview what would be converted without actually converting anything:
wj-rar2zip --dry-run /path/to/archives
This lists all RAR files found and shows a count:
Storage/Harold The Cat.rar
Storage/Finances 1999.rar
...
42 file(s) would be converted.
Deleting Originals
To delete the original RAR files after successful conversion:
wj-rar2zip --delete /path/to/archives
Note
A RAR file is only deleted after its corresponding ZIP has been successfully created. If conversion fails for a particular file, the original RAR is kept.
What Gets Preserved
- File names and directory structure — the ZIP contains the same entries as the RAR
- Internal timestamps — each file's date/time from the RAR is copied to the corresponding ZIP entry
- Filesystem timestamp — the resulting ZIP file's modification time and access time are set to match the original RAR file
Error Handling
If a RAR file cannot be converted (e.g. it is corrupt or password-protected), wj-rar2zip prints an error for that file and continues with the rest. The exit code will be non-zero if any errors occurred.