@ -49,99 +49,86 @@ After you install the needed `Plugins` - it's time to configure everything.
`deluge-mover.py` needs the requests Python module, 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 one of the following 3 options to install `requests`.
You can choose one of the following 3 options (select a tab) to install `requests`.
- [User scripts](#user-scripts)
- [Go File](#go-file)
- [Python venv](#python-venv)
=== "User scripts"
With this option, we're going to install the `requests` module when the Array is started the first time.
#### User scripts
In your unRAID Dashboard, go to your `Settings` tab and select `User Scripts` in the `User Utilities` section at the bottom.
With this option, we're going to install the `requests` module when the Array is started the first time.
With this option, we're going to install the `requests` module when the unRAID server is started.
Select in the schedule list when the script should run, and choose `At First Array Start Only`.
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"}).
![!Set Run Time](images/Unraid-settings-user-scripts-requests-schedule.png)
Copy/paste the following command
Click on `Apply`.
```bash
pip3 install requests
```
Finally, you will need to choose `RUN IN BACKGROUND` or restart your unRAID server to install the `requests` module.
=== "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 (`requests`) for this specific environment.
Restart your unRAID Server or run the above command from the terminal.
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 new Python environment.
#### Python venv
!!! info
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.
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 (`requests`) for this specific environment.
Suggestions:
By doing this, we will **only need to configure this once** and it will be persistent after reboots *(this differs from the previous steps)*.
- `/mnt/user/appdata/deluge/scripts/.venv`
- `/mnt/user/data/scripts/.venv`
First, you need to choose a location to start a new Python environment.
Run the following command in unRAID's terminal in the directory you chose:
!!! info
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.
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"}).
We now need to enter this new environment and install our dependency (`requests`) in it, run:
Copy/paste the following command
```bash
source /mnt/user/data/scripts/.venv/bin/activate
pip3 install requests
deactivate # to leave the environment
```
```bash
pip3 install requests
```
!!! info
Replace `/mnt/user/data/scripts/.venv` with the path you have chosen.
Restart your unRAID Server or run the above command from the terminal.
------
@ -152,6 +139,8 @@ Now, using your favorite text editor ([VSCode](https://code.visualstudio.com/){:
You only need to change a few options at the top of the script.
```python
### CONFIGURATION VARIABLES ###
# this webui will need to be the JSON-RPC endpoint
# this ends with '/json'
deluge_webui = "http://localhost:8112/json"
@ -164,29 +153,44 @@ deluge_password = "deluged"
# instead of only torrents in that range that exist on the cache
check_fs = False
# if you are using the mover tuner and don't want to use it for
# this script, set this to true
#
# if you do not use mover tuner, leave this as false
use_mover_old = False
# this is the absolute host path to your cache drive's downloads
# you only need this to be changed/set if using 'check_fs = True'
# the age range of days to look for relevant torrents to move
age_day_min = 2
age_day_max = 5
# i dont recommend setting age_day_max to less than the schedule
# you run the script on...
#
# if you run every 7 days, this should be at least 7 to prevent
# files from being stuck on your cache forever
#
# 0 disables age_day_max
# set both age vars to 0 to move everything on your cache drive
age_day_min = 3
age_day_max = 0
```
- `deluge_webui` => The URL you use to access Deluge locally. (*the* `"`*should remain*)
- `deluge_password` => Your Deluge WebUI `Password`. (*the* `"`*should remain*)
- `check_fs` => If set to `True`, it will check for the file on the cache drive before pausing.
- `use_mover_old` => See below.
!!! warning ""
- If you do not use `Mover Tuning`, you **DO NOT** have to make any changes.
- If you use `Mover Tuning` but **DON'T** want to use it for the script, change this to `True`
- If you use `Mover Tuning` and **DO** want to use it for the script, you will not have to make any changes. However, for this option, inside the `Mover Tuner` you will need to set `Move Now button follows plugin filters` to `Yes` and `Disable Mover running on a schedule` to `No`.
- `cache_download_path` => The location (host path) for your cache folder (if check_fs is True)
- `age_day_min` => Set the minimum age (days) of the torrents that you wish to move.
- `age_day_max` => Set the maximum age (days) of the torrents that you wish to move.
!!! warning ""
Depending on whether you use the unRAID `Mover Tuning` app, you may need to change **line 164**:
- If you do not use `Mover Tuning`, you **DO NOT** have to make any changes.
- If you use `Mover Tuning` but **don't** want to use it for the script, change **line 164** from `system('/usr/local/sbin/mover start')` to `system('/usr/local/sbin/mover.old start')`
- If you use `Mover Tuning` and **DO** want to use it for the script, you will not have to make any changes. However, for this option, inside the `Mover Tuner` you will need to set `Move Now button follows plugin filters` to `Yes` and `Disable Mover running on a schedule` to `No`.
#### Copy the script to your preferred location
Place the script you just edited somewhere easy to access/remember.