2 Attachment(s)
How to stop Autobrr adding torrents to the client in seedbox when all space used up
IMPORTANT
- This tutorial is made considering you have basic knowledge on Unix to create and save file and you have torrent content and plex media content at the path "/home/user/files"
- You know how to connect to the seedbox using ssh connection with any ssh client (I am using putty client)
- Seedbox used in example is one from the seedboxes.cc with 1000 GB space
STEPS
- Login to your seedbox using ssh (I am using putty client for ssh connection)
- Create a file in your $HOME directory (your home directory on seedbox) and give it any name you want, I used "freespace.sh"
- Enter below shell script code in that file and save the file:
Code:
#!/bin/bash
set -e
TOTAL_SPACE=980418560 # 935GB
REQ_SPACE=52428800 #50GB
USED_SPACE=`du -s "$HOME/files" | awk 'END{print $1}'`
AVAILABLE_SPACE=`expr $TOTAL_SPACE - $USED_SPACE`
if [[ $AVAILABLE_SPACE -le $REQ_SPACE ]]
then
exit 1
fi
exit 0
- Run below command after saving the file to make the file executable (Important):
chmod +x ~/freespace.sh - Now go to your autobrr dashboard and edit the filter where you need to add this functionality
- Select the "External" tab in the filter edit option and click on "Add New" (refer screenshot below)
- Switch on the functionality by clicking Radio button previous to the name (refer rectangle in Green color)
- Provide "TYPE" as "Exec" (refer arrow 1) and Name (refer arrow 2) as any name you want , I used "Full_Space"
- In "PATH TO EXECUTABLE" box provide full name of the shell script file with path included. Refer screenshot example given with arrow 3
- In "EXPECTED EXIT STATUS" box provide value as "0" (arrow 4)
- Finally click on save (refer rectangle in Red color) if everything is looking like the details given in the screenshot below
- This needs to be done in all the filters created for any indexer on autobrr.
- Enjoy and no more need to check available space on the seedbox every now and then
NOTE:
- For safer side I have kept total space as 935GB instead of 1000GB.
- If your usable total space on seedbox is greater than 1000 GB then you can change the value of the variable "TOTAL_SPACE" accordingly using the formula: Total GB * 1024 * 1024.
E.g. For total usable space of 3000 GB, total space will be 3000*1024*1024=3145728000
So, it will look like this: TOTAL_SPACE=3145728000 # 3000GB - I am checking for the minimum availability of 50 GB space to add the torrent to the client. For file size greater than 50GB you can change the value of the variable "REQ_SPACE" accordingly.
E.g. For file size of 80GB it will be 80*1024*1024=83886080
REQ_SPACE=83886080 #80GB
Feel free to suggest any improvement to this tutorial and point out errors if anything is not correct :)