A Perl script to iterate through a root directory looking for split-volume RAR archives and extract them.
mass_extract.pl [OPTIONS]| Option | Description |
|---|---|
-r, --root <dir> |
Root directory to recursively search for RAR archives (required) |
-o, --output <dir> |
Output directory for extracted files (default: extract in place) |
-d, --delete |
Delete RAR files after successful extraction and CRC verification |
-l, --log <file> |
Write extraction log to CSV file |
-h, --help |
Show help message |
-g, --gui |
Launch GUI for selecting options |
Extract in place:
./mass_extract.pl -r ~/downloadsExtract to a different directory:
./mass_extract.pl -r ~/downloads -o ~/moviesExtract, verify, and delete original RAR files:
./mass_extract.pl -r ~/downloads -o ~/movies -dExtract with logging:
./mass_extract.pl -r ~/downloads -o ~/movies -d -l extraction.logLaunch GUI mode:
./mass_extract.pl -gWhen launched with the -g option, the script provides a graphical user interface:
-
Options Window: First, a window appears allowing you to:
- Browse and select the root directory
- Browse and select an output directory (optional)
- Enable deletion of RAR files after extraction
- Select a log file location (optional)
-
Progress Window: During extraction, a progress window displays:
- A progress bar showing overall extraction progress
- Current directory being processed
- Real-time output from the unrar command
- Extraction status messages
The progress window keeps you informed about which archives are being extracted and shows the actual unrar command output as it happens.
When using the -l option, a CSV log is created with the following columns:
- Timestamp: When the action occurred
- Source Directory: Directory containing the RAR files
- RAR File: Name of the RAR archive
- Output Directory: Where files were extracted to
- Action: Type of action (extract, verify, delete, scan)
- Status: Result (success, failed, complete)
- Details: Additional information about the action
The script preserves directory structure when using the -o option:
Source: ~/downloads/movies/action/movie1/*.rar
Output: ~/output/movies/action/movie1/extracted_files
.rarfiles (main archive).r00,.r01, etc. (old-style split volumes).part1.rar,.part2.rar, etc. (new-style split volumes)
- Perl 5 with the following modules:
- File::Find (core)
- File::Copy (core)
- File::Basename (core)
- File::Path (core)
- Cwd (core)
- Getopt::Long (core)
- POSIX (core)
- Tk (for GUI mode)
- Tk::ProgressBar (for GUI mode)
unrarcommand-line tool