Recursive Unrar with Deletion as it progresses
- by Jharwood
Basically, i have a set of directories that are constantly being filled with .rar's, and i need to be able to extract them in place with automatic deletion of the left over .(rar|rXX) files. How would i go about this?
Note: I can't delete all of them once done, they have to be deleted as the script completes one rar set.
Example Directory Structure:
/
/folder1/
/file1.rar
/file1.r00
/file1.r01
/folder2/
/sub.folder1/
/file2.part001.rar (contains a directory "file2")
/file2.part002.rar
/file2.part003.rar
/sub.folder2/
/file3.rar
/file3.r00
/file3.r01
Expected Result:
/
/folder1/
/file1.ext
/folder2/
/sub.folder1/
/file2/
/file2.ext
/sub.folder2/
/file3.ext