Created
September 3, 2019 01:15
-
-
Save sachk/6690ed0f217faf4bfb87f03805e2a8c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
####################################### | |
### NZBGET POST-PROCESSING SCRIPT ### | |
# Moves downloads to a configured location using rclone and load balances over | |
# multiple remotes | |
# | |
# | |
# NOTE: Requires sh, coreutils or busybox, screen and rclone. Remotes must be setup in rclone.conf. | |
######################################## | |
### OPTIONS | |
# Comma seperated list of rclone remotes to load balance, no spaces | |
#Remotes=drive1,drive2 | |
# Path in the remotes to copy files to | |
#Path=movies/nzbget/ | |
# Options to add to the end of the rclone command | |
# | |
# | |
# NOTE: Specify the location of rclone.conf here if it is not in the default | |
# location for the user running nzbget. | |
# INFO: Increasing drive-chunk-size will | |
# increase speed but also increase memory usage. | |
#Options=--transfers 1 --drive-chunk-size 16M -P | |
### NZBGET POST-PROCESSING SCRIPT ### | |
####################################### | |
REMOTE=$(echo $NZBPO_REMOTES | tr , '\n' | shuf | sed -n '1p') | |
MOVEPATH=""$REMOTE":"$NZBPO_PATH""$(basename "$NZBPP_DIRECTORY")"" | |
COMMAND="rclone moveto \""$NZBPP_DIRECTORY"\" \""$MOVEPATH"\" "$NZBPO_OPTIONS"" | |
echo "[INFO] "$COMMAND"" | |
eval screen -d -m "$COMMAND" | |
exit 93 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment