Unzipping after download qbittorrent

I’m new to Truenas Scale but ran Freenas for a long time as a light user. I need a little help unzipping (rar) on the server itself. I used to use unrar with (I think) a link setup and run from command line in my old system. I’m hoping someone has instructions somewhere how to get this setup to automatically unrar/unzip after download. I’m not sure how to go about installing 7z or similar and get it up and running.

It’s my understanding the install of 7z or similar will not survive an upgrade of the OS.

Thanks for any help or anywhere you can point me? I’ve searched a lot and couldn’t find much . One thread complaining that 7z didn’t come installed but nothing with a full setup.

Thanks!

1 Like

First, add your vote to this request.

Second, do you mean to automatically extract the files after completion? Or that you want to be able to do so manually on the server itself?

Voted!
Ideally automatically would be great, but I was doing it manually for years before. I’ll take what I can get as long as I don’t have to pull it down to my local machine just to unzip and put it right back up.

That might not work with Docker at the moment. (I don’t believe you can access the host’s filesystem from an application that exists as a container.) And it would be unwise to expose the host’s entire filesystem to a container.

With a “Linux jail / sandbox”, it’s theoretically possible, in the same way it can be done with a FreeBSD jail.


To do it manually (in the meantime), you can download a portable version of 7zip and “install” it on a storage dataset, then add the binary (7zzs) location to your user’s $PATH. You can optionally create an “alias” of 7z to reference the binary 7zzs.

This will also survive reboots and updates.

1 Like

Thanks for your quick response. I will try the manual option. I’ll have to do a bit of research to figure out exactly what you mean, but I think you’ve given me enough to get going. Thanks!

I found that my app user had 7z installed in usr/bin already without me doing anything. I suppose it’s possible it got installed with another app. However I can’t get 7z to extract rar files. I’m using:

7z e -r [Folder containing archives I want to extract]

This doesn’t seem to work. Am I missing something?

You probably used the “Multi-Report” script at one point in the past. It will install 7zip.


What’s the error message?


That’s going to dump all the files directly into your current working directory. I’d advise against that.

Extracting archive: myArchive.rar
ERROR: myArchive.rar
Cannot open the file as archive

“That’s going to dump all the files directly into your current working directory. I’d advise against that.”
correct, just testing and I’m ok with it being extracted there.

I also tried extracting from a folder above using -r flag with the same issue.

That is very true, however if you run Multi_Report and you tell it to encrypt the config file, 7zip will load again.

1 Like

What does the command file myArchive.rar reveal?

Can you even list its contents?

7z l myArchive.rar
1 Like

One last thing, okay two last things…

  1. What version of TrueNAS are you running?
  2. Have you installed Multi-Report?
    I know there was a request for 7zip to be added to SCALE, but I don’t know if it was. As far as I know you could be running a nightly that has 7zip. If that is the case and you feel it is faulty, report it.

SCALE 24.04 and later are locked down pretty hard. We can get past that but I only recommend that for someone who assumes the risk and will not badmouth TrueNAS if they screw up. Examine Multi-Report script if you want the trick.

  1. Where are you extracting the file to? Be precise.

Version: TrueNAS-SCALE-24.04.2
I Don’t think I installed Multi-Report. Definately not through the CLI, but I have clicked on NetData in the reporting section if that did it.

As for listing what’s in the archive, I get the same error: Cannot open the file as archive. I’ve verified I can open the file locally if I pull it down. I should note, this is a split rar archive so there are .r01, .r02 etc.

Also note that 7z is installed for the Apps user: 568. and that’s who I am shelling with.

Thanks all.

I was able to use 7z to list and unpack a tar file. Is there an addon I need to install for 7z to be able to work with rar files?

All of them are in the same directory with the initial .rar file?

What version of 7z is installed?

You can run the 7z command without any parameters.

yes, all are in the same dir.
version 7-Zip (z) 23.01 (x64)

Have you tested with a non-split RAR archive?

Can you test this again, but renaming the files into this naming format:

myArchive.part1.rar <--- originally myArchive.rar
myArchive.part2.rar
myArchive.part3.rar
myArchive.part4.rar

Will do but just found this:

in 7 Zip version 24.01 this was added:
7-Zip now can unpack RAR archives (that use larger than 4 GB dictionary) created by new WinRAR 7.00.

The archive I’m extracting is about 7 GB. Could this be the issue?

Can I just grab the newer version (7z2408-linux-x64 (2).tar.xz) and just drop the extracted 7zz file over the one in the /usr/bin directory?

You can test this out by manually fetching the latest 7zzs binary. :point_down:


You can still try to rule out the possible hurdle of the “naming convention”, if it expects the files to be named and sorted in a certain format.

Thanks. I’ve seen these instructions before but I’m a bit fuzzy on what this means. Would the below steps work?

  1. extract the tar file on my win machine
  2. copy the 7zz file over to the /usr/bin directoy overwriting the existing one.
  3. should work as is?