Unzipping after download qbittorrent

I wouldn’t do that. It won’t survive upgrades, and it’s best not to overwrite pre-installed binaries.

Just plop the 7zzs binary somewhere safe, and either make it an “alias” or add it to your user’s $PATH.

So let’s say you dump it in here:

/mnt/poolname/homes/jimmy/.bin/7zzs

Then you can create an “alias” in your bash or whatever config file:

alias 7z="/mnt/poolname/homes/jimmy/.bin/7zzs"

could I mv 7zz to 7zzOld to keep it just in case before putting the new one out ther?

See my above post, it’s the preferred method, and doesn’t involve touching the OS/system files.

ok, give ma a minute to try this out. Thanks!

Keep in mind you only need the 7zzs binary from the download, and nothing else. Of course, it’s up to you if you also want the docs/manpages.

EDIT: Of course, the real “solution” is for iX to include 7z with SCALE by default, and naturally track the latest version.

Bingo! This worked. Thanks for walking me through this. Just to finalize this for anyone else it might help, this is what I did and could be modified by changing some of the locations/names:

  1. Download the 7-Zip (console version) for 64-bit Linux x86-64 (AMD64) should be a .tar.xy file.
  2. extract the 7zzs file
  3. place it somewhere the user can get to it. for me it was in /downloads.
  4. alias myZip=“/downloads/7zzs”
  5. Now I can use this to extract: myZip e [Achive File]
1 Like

One this I noticed is that every time I shell back in, I have to recreate the alias.

Ie nano ~/.bashrc

Then add the alias line at the bottom.

Relogin to your shell

1 Like

Le French monsieur is correct.

I’m getting this error when trying to save the file:
[ Error writing //.bashrc: Read-only file system ]

As I tried to achieve the same thing, that post-author I would like to share my solution to this problem. :slight_smile:
I followed @winnielinnie’s suggestion, downloaded a portable version of 7zip, and extracted binary from tar on a storage dataset (/mnt/FastTank/qBittorrent_config). Then using ChatGPT and trial by error got this bash script to work from TrueNAS Scale shell:

#!/bin/bash
find /mnt/BigTank/Downloads/ -name ‘*.rar’ -execdir /mnt/FastTank/qBittorrent_config/7zip/7zz x -o./ -aos ‘{}’ ;

After, that under:
System → Advanced Settings → Cron Jobs → Add:

Description: Extract archives
Command: bash /mnt/FastTank/qBittorrent_config/script.bash
Run As User: my_user
Schedule: Custom */10 * * * *) Every 10 minutes
Hide Standard Output: Checked
Hide Standard Error: Unchecked
Enabled: Checked

So far it works without problems. I had added my e-mail address under my_user profile and configured SMTP, so at the beginning when I fine-tuned the script I got emails alerts if script failed to run with an error message. Also script checks and if there is already extracted file 7zip will skip those arhives.

1 Like

How are you trying to edit the file?

Is it the one of your host system user’s config? (It’s not inside a container, is it?)

Interesting; I don’t see a “delete the archive” so, wouldn’t that cron job just keep extracting archives found in ‘Downloads’ every 10 minutes (unless I read the 7zz switch’s incorrectly–if so, then, sorry for the question)?

Also, you just want to keep the extracted files in ‘Downloads’ (I should add that this question pertains to the possibility of your cron job/script descending into sub directory tree’s–each successive extraction adding to inefficiencies)?

The -aos flag prevents that.

Ah. Got it. I guess my mistake was trying to use the man page.
https://manpages.debian.org/testing/7zip/7zz.1.en.html#ao_a_s_t_u_

For future readers, the following explains the -aos switch much better.
https://documentation.help/7-Zip/overwrite.htm

1 Like

Yes, I use qBittorrent occasionally. Maybe a few torrents a month. And the content goes through a natural life cycle. After downloading and consuming it if I like it I usually move it to permanent storage and leave torrent to seed for a couple of weeks before I delete it.

Wanted to update my experience with this workflow.
It has a major flaw - as the script triggers based on time and not on finished download it will try to extract unfinished archives. As a result, you will receive many alert emails with “Headers Error” and from a partly downloaded archive script will extract broken file/files. In my case, there were multiple video files and some of those video files won’t play because that specific video files archive wasn’t fully downloaded at the time when the script was launched.

Currently, I have disabled the script and in the future will try to fix it so the script is triggered not by TrueNAS Scale cronjob, but by qBitttorent itself. So if someone knows how to fix it or has a link to guide or post, please, let me know.

image

Set qBittorrent to keep in-progress downloads in a separate folder, then move them into a final destination folder once they’re complete.

This is configured via qBittorrent’s Options->Downloads->‘Keep incomplete torrents in:’ setting

Have your script look in the completed downloads folder, not the in-progress one, and you should be good

3 Likes

Thanks for the great advice. I knew about this possibility but didn’t think of it at the time.

1 Like

Still interesting to ME (but other people may find this about as interesting as watching paint dry).
So the process is:

  1. Program downloads the package to temp folder.
  2. Program moves the final package to completed folder.
  3. cron runs your script, every 10 minutes, to extract any “new” package found in the completed folder.
  4. you manually move package contents to another location.

Is that a good summary?

What I mainly find interesting about this is the “manual” portion. Can you automate the manual part?

NOTE: I think I’ve downloaded one (1) torrent, ever, so I don’t know anything about them, but I’m interested in how you’re solving this problem(s). You should also note that when I did some compiler stuff, I found the whole linguistics problems fascinating so feel free to ignore my question.