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:
Download the 7-Zip (console version) for 64-bit Linux x86-64 (AMD64) should be a .tar.xy file.
extract the 7zzs file
place it somewhere the user can get to it. for me it was in /downloads.
alias myZip=“/downloads/7zzs”
Now I can use this to extract: myZip e [Achive File]
As I tried to achieve the same thing, that post-author I would like to share my solution to this problem.
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:
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.
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)?
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.
Still interesting to ME (but other people may find this about as interesting as watching paint dry).
So the process is:
Program downloads the package to temp folder.
Program moves the final package to completed folder.
cron runs your script, every 10 minutes, to extract any “new” package found in the completed folder.
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.