Skip to content

Instantly share code, notes, and snippets.

@sachk sachk/RcloneMove.sh
Created Sep 3, 2019

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.