Page 1 of 1

Pre-Queue Script - Temp Folder Based on size.

Posted: January 4th, 2015, 3:54 pm
by pyro1509
Hello,

I was hoping to reduce some disk thrashing with my downloads.

My system (ubuntu) has ~8GB of ram and uses nearly non of it. Of course the verify, repair, and extraction all take up a lot of IO cycles.

The majority of my downloads are <2GB but I do have the occasional 10GB+ download.

So I would like to make a pre-process script which if the DL was <=2GB it would use a temp folder that is a ramdisk (tmpfs of ~3GB). Anything greater than that would then IO to the normal hard disk. This would reduce any disk action to only the extraction (greatly speeding up all the other actions).

The input parameter #6 is the size in bytes so that makes the process easy to start. But I am confused on how to get SAB to put certain downloads into different temp folders.

My inkling is to take the name of the NZB (which would be the resulting tmp folder name) and create a symlink to the tmpfs. Then when it write to Downloads/incomplete/New_NZB/ -> /tmpfs/New_NZB/

Code: Select all

if [$6 -gt 2000000000] then
ln -s /tmpfs/$1 Downloads/incomplete/$1
fi 
I think I might run into issues with SAB incrementing New_NZB.1

Any suggestions on how to make this a bit more elegant?

Re: Pre-Queue Script - Temp Folder Based on size.

Posted: March 3rd, 2015, 2:07 pm
by derkens
You should probably make 2 categories with different paths,
use the pre-queue script to switch between them.

Code: Select all

if   "$6" -lt "2000000000" ; then
echo "1"    
echo
echo
echo "nameoftmppathcategory"
echo
echo
echo

Re: Pre-Queue Script - Temp Folder Based on size.

Posted: October 15th, 2022, 4:11 pm
by fandangos
I'm necrobumping this because this is still relevant today.

I have 32GB of RAM available and I could spare 15GB for a ram disk to use with Sab.
I get the idea of linking but that's not ideal.

How possible would be to have a built in feature to select the temporary folder based on download file size?
Or how can this be done instead of linking?

I often download content that is smaller than 15GB but sometimes it goes beyond 60GB.
Could this be done using sab's API from a command line?

Re: Pre-Queue Script - Temp Folder Based on size.

Posted: October 16th, 2022, 2:15 am
by safihre
Currently there's no way to set job specific temporary folders. When the queue script is called, the directory is already created so I don't know if the suggestion in the first post using "ln" would even work.

Re: Pre-Queue Script - Temp Folder Based on size.

Posted: October 16th, 2022, 4:21 am
by sander
Google LVM with Ramdisk and normal disk