-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Output Dir, and check if file is not allready there before extracting. #10
Comments
Correct, we don't support that. Since it's been asked for quite a lot, we probably should. The reason I haven't done it is because I can't find a way that suits me. The only way I can think of is to write to a randomly generated folder in /tmp, clean the results on there, and then copy to the output dir. Guess we could check the file list from the rar file and then check the output dir if the file exist.
What do you think? |
Hey ! Thanks for your quick reply ! What kind of ram do you need ? I actually have some i m not using ... i'd be happy to send it to you if it's the kind you need ... Regarding the script: -A friend of mine actually wrote a small script for my need. You can find it here: As you can see he is just checking the name of the files inside the archive before extracting it. And he writes the name of the extracted file in a txt to avoid extracting it multiple times. I guess you could implement that in unrarall with a trigger for the input and output dir, wich would give: unrarall -input /my/rar/files -output /my/unrared/files That would just be an option added to unrarall ... I guess you could do the same with the tmp dir option if lot s of people asked for it ! To answer your questions: -I guess we shouldn t check the md5sums before of course ... i guess most of the people use that kind of script for automation, so overwriting or spitting a warning is not a good idea either. Sorry if my explanations are not good, english is not my birth language. Regards. |
Using a tmp dir in the output dir makes much more sense than going through /tmp. I don't like the txt file idea, I'd rather just dynamically check, unrar & 7zip seem very fast at spitting the information out anyways. Anyways i'll have a bash at it when I get a minute, on travel for work atm. Or you can give it a go if like ;-) Moi non plus c'est pas ma langue maternelle ;-) Don't worry about the ram, Since I've moved to tmpfs and removed swap due to using mostly SSDs for non data stuff though i've had a few surprises doing things I use to do in /tmp (especially in machines with 1GB)... |
@arfoll When did we start doing MD5 sums? I thought the cksfv were just checking CRC32? k I like the sounds of the output dir option. Would the intention be to recreate the directory structure found in the root (where unrarall starts its search) inside the output directory. For example let's say we have
and we run
do we get... (this makes more sense to me)
or do we get...
? @oursours Checking if the file is already extracted could be unreliable. For example if unrarall was killed during extraction then files with the correct name could be left behind but they would not be correct. If someone proceeded to run unrarall again then if we simply check the correct filename exists we will skip extraction even though the file(s) were not correctly extracted previously. Do we think is acceptable? I suppose we could show a warning when we skip over files. |
@delcypher I think I explained badly, the md5sums would there exactly to fix the problem you ask oursours... sfv files just check the integrity of the archive files, not their contained files. By checking the md5sum of the files written against the files in the archive (not entirely sure how) we could fix the issue. Recreating the top level dir would be nicer I agree. As for the cleanup hooks I guess we need source & output cleanups, but I suggest we dont run the source cleanups in this case, as I'm guessing the reason to do this is mostly to keep the source as it came. |
Has anyone ever come back to this? I would definitely like to see an output folder. That way I can run for example: twice (back-to-back) and cover all the rar-in-rars as well, and then have a somewhat organized "Extracted" folder for easy rectifying later. As-per delcypher's comment about whether you get "outputdir/Superbad/Superbad.mkv" or "outputdir/Superbad.mkv", isn't that what the difference is in the switch --full-path? or does --full-path do this: Again, I would really, really, want an output directory capability. |
@strider2112 If you're happy to have everything extracted into the same output directory then this should be easy to implement. |
Hmmm. It already makes a bit of a mess of my Downloads folder. This would just help automate the cleaning process. As far as I know, every extraction program offers some sort of "destination folder" option. As for the original question, I would rather not have the directory structure be with the folder that the rar was in, for me this would end up with: Etc. Because every rar I have is in "Downloads". If that makes sense, this option would nastify things |
@strider2112 I've implemented this feature ( @arfoll Could you check this doesn't break anything for you? |
I would be happy to test it. I just gotta get it onto my server, this will take a couple hours (I don't have remote access right now) Just to clarify, with the new --output flag, is the proper syntax like so? |
The options always come before the mandatory directory argument so
is correct. The output flag doesn't use the |
It doesn't matter for right now, I just got the code onto my server (I got access to my ssh tunnel), I am going to test it now, I just need a rar file... Although it makes more sense to use the I will test it soon on a more complicated rar. A set of 6 parts, encrypted, and probably each filled with 20-30 rar parts. We'll see how she does... |
@strider2112 Thanks for testing. I think I might keep the |
@delcypher I agree with you 100%. I think the last missing 'feature' is for a cleanup hook to wipe the empty dir if clean=all made the dir with rar files empty. |
@delcypher Do you mean keep it without the Either way, I'm happy with the functionality. Good news boys! I tested the script with two rar sets: |
@strider2112 . I meant keep |
@arfoll I'm not sure if that's a desirable feature. If you do
you might not want the current working directory removed Similarly if you do something like
you probably don't want your Or do you mean remove empty directories inside the specified directory? For the |
I don't think housecleaning should be your responsibility. The --clean feature is great because for me it automates the removal process for .rar files and .nfo files, etc. But to have it go too deep into removing directories is kind of scary. What if I have my Extracted folder sub-directoried so that I have a few "buffer" directories like this: I wouldn't want the script to delete |
@strider2112 housecleaning is exactly what unrarall is for ;-) @delcypher so if you have the dir structure: Anyways, just a thought, it seems to me like something logical that most people would want in this case. But doesn't hinder your patch going to master. It works ok for me. |
@delcypher so is there a new Master copy of the script that is ready for me to download? I will be sure to test it for bugs. I'm new to GitHub, is there any way that I can set up so that it emails me if a new release is done? (ie. if you do decide to add further cleaning functionality). @arfoll I didn't know that you originally wrote unrarall for housecleaning purposes. My biggest reason to use it is that it is quick, easy, and can handle all my archives. But now that I think about it - housecleaning makes perfect sense. I'm sure whatever gets done will be logical. |
Quick question regarding functionality of this script, if I were to modify this: I'm kind of new to bash programming, but this makes sense to me. |
I've pushed the code into the master branch of this repository. It's mostly the same as what I had in the
I think "watching" the repository will give you this information but I think you will get notified about everything that happens in this repository. Take a look at the GitHub docs on this
That is correct. |
@arfoll It looks like writing a clean up hook to remove empty directories that doesn't delete the root is trivially easy with |
@delcypher trivially easy? Wow sounds like it should be done STRAIGHT AWAY! only the directory that contained the rar files. The output dir should not On 14 November 2014 22:29, Dan Liew notifications@github.com wrote:
|
I'll give it a go.
facepalm you're right. Empty rar files sounds like an edge case not worth caring about. |
@arfoll If all's well we should probably bump the version number and make a new release. |
@delcypher so did this got implemented? If yes, how? Like the previous mentioned command? $ unrarall --clean=all --output ~/mystuff/ ~/Downloads ? |
@xieem I believe it was implemented. Read |
@xieem the output directory was implemented and is in the master file. It works just like how you're asking. As for this advanced cleanup they last talked about, I'm not sure. I never downloaded an update since then. |
Hi,
first of all thanks for the great work ! :)
This script is really nice and works perfectly for me.
I m just wondering if there is a way to specify an output dir ? ( i red carefully the doc but seems not ... ). That would be really nice if we could and also check if the file isn't allready extracted in the output directory.
Regards.
The text was updated successfully, but these errors were encountered: