diff --git a/docs/Downloaders/Deluge/Tips/Unraid-Mover.md b/docs/Downloaders/Deluge/Tips/Unraid-Mover.md index f6c2bd96c..04fc0d17f 100644 --- a/docs/Downloaders/Deluge/Tips/Unraid-Mover.md +++ b/docs/Downloaders/Deluge/Tips/Unraid-Mover.md @@ -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. + ![!User Scripts](images/Unraid-settings-user-scripts-icon.png) -In your unRAID Dashboard, go to your `Settings` tab and select `User Scripts` in the `User Utilities` section at the bottom. - -![!User Scripts](images/Unraid-settings-user-scripts-icon.png) - -At the bottom of the `User Scripts` page select the `ADD NEW SCRIPT` button. - -![!Add New Script](images/Unraid-user-scripts-add-new-script-icon.png) - -A popup will appear asking you to name the script. For this example, we're going to use `Install requests (deluge-mover)` and then click on `OK`. - -![!Install requests module](images/Unraid-user-scripts-add-new-script-enter-name.png) + At the bottom of the `User Scripts` page select the `ADD NEW SCRIPT` button. -Click on the cogwheel of the new script in the list, and select `Edit Script`. + ![!Add New Script](images/Unraid-user-scripts-add-new-script-icon.png) -![!Select user script](images/Unraid-settings-user-scripts-edit-requests.png) + A popup will appear asking you to name the script. For this example, we're going to use `Install requests (deluge-mover)` and then click on `OK`. -Copy/Paste the following in the new window that opens, then click `SAVE CHANGES`. - -```bash -#!/bin/bash -pip3 install requests -``` - -![!Bash script](images/Unraid-settings-user-scripts-requests.png) - -Select in the schedule list when the script should run, and choose `At First Array Start Only`. + ![!Install requests module](images/Unraid-user-scripts-add-new-script-enter-name.png) -![!Set Run Time](images/Unraid-settings-user-scripts-requests-schedule.png) + Click on the cogwheel of the new script in the list, and select `Edit Script`. -Click on `Apply`. + ![!Select user script](images/Unraid-settings-user-scripts-edit-requests.png) -Finally, you will need to choose `RUN IN BACKGROUND` or restart your unRAID server to install the `requests` module. + Copy/Paste the following in the new window that opens, then click `SAVE CHANGES`. ------- + ```bash + #!/bin/bash + pip3 install requests + ``` -#### Go File + ![!Bash script](images/Unraid-settings-user-scripts-requests.png) -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. + ```bash + python3 -m venv --clear /mnt/user/data/scripts/.venv + ``` -Suggestions: + We now need to enter this new environment and install our dependency (`requests`) in it, run: -- `/mnt/user/appdata/deluge/scripts/.venv` -- `/mnt/user/data/scripts/.venv` + ```bash + source /mnt/user/data/scripts/.venv/bin/activate + pip3 install requests + deactivate # to leave the environment + ``` -Run the following command in unRAID's terminal in the directory you chose: + !!! info + Replace `/mnt/user/data/scripts/.venv` with the path you have chosen. +=== "Go File" + With this option, we're going to install the `requests` module when the unRAID server is started. -```bash -python3 -m venv --clear /mnt/user/data/scripts/.venv -``` + 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' cache_download_path = "/mnt/cache/torrents/completed" # 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.