# How to run the unRaid mover for qBittorent seeding torrents
# unRAID Mover and qBittorrent
When you make use of the unRaid cache drive for your `/data/torrents` share and the torrents in qBittorent are still seeding then the mover can't move files, because they are still in use.
When you make use of the unRAID cache drive for your `/data/torrents` share, and the torrents in qBittorrent are still seeding, the mover can't move files since they are still in use.
Using the following instructions you will be able to move the files with the use of the qBittorrent API.
Using the following instructions will allow you to move the files with the use of the qBittorrent API.
!!! abstract "Workflow Rules - [Click to show/hide]"
!!! abstract "Workflow Rules"
1. Pause torrents older than last x days.
1. Run the mover.
1. Resume the torrents once the mover is completed.
1. Pause torrents in a specified age range that reside on your cache drive.
1. Run the unRAID mover.
1. Resume the torrents after the mover has completed.
!!! warning
The screenshots are just examples to show you how it should look and where you need to place the data that you need to add, they aren't always a 100% reflection of the actual data and not always 100% up to date with the actual data you need to add.
The screenshots below are only **EXAMPLES** to show you how it should look and where you need to place the data that you need to add. They are **NOT** always a 100% reflection of the actual data, and not always the actual values you need to add.
- Always follow the data described in the guide.
- If you got any questions or aren't sure just click the chat badge to join the Discord Channel where you can ask your questions directly.
- Always follow the recommendations described in the guide.
- If you have any questions, or aren't sure, just click the chat badge to join the Discord Channel where you can ask your questions directly.
!!! info "<sup>(*1*)</sup> These needs to be installed from the NerdTools."
!!! info "<sup>(*1*)</sup> These need to be installed from NerdTools."
------
## Setup
After you installed the needed Plugins it's time to configure everything.
After you install the needed `Plugins` - it's time to configure everything.
### qBit API
### `qbittorrent-api` module
The script needs the qBit API to work, so we need to make sure it's installed when your unRaid server is booted or when the Array is started the first time.
The script needs the qbittorrent-qpi module to work, so we need to make sure it's installed when your unRAID server starts, or when the Array is started the first time.
You can choose from the following 3 options how you want to install it, depending what you preference.
You can choose one of the following 3 options (select a tab) to install `qbittorrent-api`.
- [User scripts](#user-scripts)
- [Go File](#go-file)
- [Python venv](#python-venv)
=== "User scripts"
With this option, we're going to install the `qbittorrent-api` module when the Array is started the first time.
#### User scripts
With this option we're going to install the qBit API when the Array is started the first time.
Go to your unRaid Dashboard to your settings tab and select in the `User Utilities` at the bottom the new plugin you installed `User Scripts`.
In your unRAID Dashboard, go to your `Settings` tab and select `User Scripts` in the `User Utilities` section at the bottom.
Click in the list on the cogwheel of the new user scrip you made.
Click on the cogwheel of the new script in the list, and select `Edit Script`.
![!Select user script](images/Unraid-settings-user-scripts-list-select-qbit-api.png)
Copy/Paste in the new windows that opens the following bash command followed by`SAVE CHANGES`.
Copy/Paste the following in the new window that opens, then click`SAVE CHANGES`.
```bash
#!/bin/bash
@ -88,49 +83,34 @@ Select in the schedule list when the script should run, and choose `At First Arr
![!Set Run Time](images/Unraid-settings-user-scripts-qbit-api-schedule.png)
Click on `RUN IN BACKGROUND` or restart your unRaid server so the qBit API is installed.
Click on `Apply`.
![!RUN IN BACKGROUND](images/Unraid-settings-user-scripts-qbit-api-run-background.png)
------
Finally, you will need to choose `RUN IN BACKGROUND` or restart your unRAID server to install the `qbittorrent-api` module.
#### Go File
With this option we're going to install the qBit API when the unRaid server is started.
On your USB stick/key go to `/boot/config` and open the `go` file with your favorite editor ([VSCode](https://code.visualstudio.com/){:target="_blank" rel="noopener noreferrer"}/[Notepad++](https://notepad-plus-plus.org/downloads/){:target="_blank" rel="noopener noreferrer"}) and copy/paste the following command.
```bash
pip3 install qbittorrent-api
```
Restart your unRaid Server, or run the above command from the terminal.
------
#### Python venv
![!RUN IN BACKGROUND](images/Unraid-settings-user-scripts-qbit-api-run-background.png)
With this option we're going to create a [Python virtual environment](https://docs.python.org/3/library/venv.html) on our disks to run and store isolated dependencies for this specific environment.
=== "Python venv"
With this option, we're going to create a [Python virtual environment](https://docs.python.org/3/library/venv.html) on our disk. We will use this to run and store dependencies (`qbittorrent-api`) for this specific environment.
By doing so, we **only need to setup this step once** and it will be persistent after reboots _(this differs from the previous steps)_.
By doing this, we will **only need to configure this once** and it will be persistent after reboots *(this differs from the previous steps)*.
First, you need to choose a location to start a clear python environment.
First, you need to choose a location to start a new Python environment.
!!! info
In the next steps, you will be ask to choose a [location to place the script](#copy-script-to-your-preferred-location), try to be consistent.
In the next steps, you will be asked to choose a [location to store the script](#copy-script-to-your-preferred-location), try to be consistent.
Suggestions:
- `/mnt/user/appdata/qbittorrent/scripts/.venv`
- `/mnt/user/data/scripts/.venv`
Run the following command on Unraid terminal within the location you chose:
Run the following command in unRAID's terminal in the directory you chose:
We now need to enter into this new environment to install our dependencies (`qbittorrent-api`) on there, run:
We now need to enter this new environment and install our dependency (`qbittorrent-api`) in it, run:
```bash
source /mnt/user/data/scripts/.venv/bin/activate
@ -139,15 +119,27 @@ deactivate # to leave the environment
```
!!! info
Replace the `/mnt/user/data/scripts/.venv` to the chosen path before.
Replace `/mnt/user/data/scripts/.venv` with the path you have chosen.
=== "Go File"
With this option, we're going to install the `qbittorrent` module when the unRAID server is started.
On your USB stick/key go to `/boot/config` and open the `go` file with your text editor ([VSCode](https://code.visualstudio.com/){:target="_blank" rel="noopener noreferrer"}/[Notepad++](https://notepad-plus-plus.org/downloads/){:target="_blank" rel="noopener noreferrer"}).
Copy/paste the following command
```bash
pip3 install qbittorrent-api
```
Restart your unRAID Server or run the above command from the terminal.
------
### Script
Edit the script with your favorite editor ([VSCode](https://code.visualstudio.com/){:target="_blank" rel="noopener noreferrer"}/[Notepad++](https://notepad-plus-plus.org/downloads/){:target="_blank" rel="noopener noreferrer"}) you downloaded at the beginning of the guide [HERE](#the-script).
Now, using your favorite text editor ([VSCode](https://code.visualstudio.com/){:target="_blank" rel="noopener noreferrer"}/[Notepad++](https://notepad-plus-plus.org/downloads/){:target="_blank" rel="noopener noreferrer"}) edit the script you downloaded at the beginning of the guide ([HERE](#qbit-mover-script)).
You only need to edit a few options in the script
You only need to change a few options at the top of the script.
```python
# --DEFINE VARIABLES--#
@ -177,9 +169,9 @@ qbt_pass = None
- If you use `Mover Tuning` but **don't** want to use it for the script, do not change **line 68**
- If you use `Mover Tuning` and **do** want to use it for the script, change **line 68** from `os.system('/usr/local/sbin/mover.old start')` to `os.system('/usr/local/sbin/mover start')`. For this option, inside the `Mover Tuner` options you will also need to set `Move Now button follows plugin filters` to `Yes` and `Disable Mover running on a schedule` to `No`.
#### Copy script to your preferred location
#### Copy the script to your preferred location
Now it's time to place the script you just edited somewhere easy to access/remember.
Place the script you just edited somewhere easy to access/remember.
Suggestions:
@ -188,29 +180,29 @@ Suggestions:
#### Final steps
Now it's time to setup the scheduler when the mover should run.
Set up the scheduler for when the mover should run.
Go to your unRaid Dashboard to your settings tab and select in the `User Utilities` at the bottom the new plugin you installed `User Scripts`.
In your unRAID Dashboard, go to your `Settings` tab and select `User Scripts` in the `User Utilities` section at the bottom.