Automation Seedbox download to home NAS

!/bin/bash

mirror -c -P5 --log=/home/xbmc/logs/synctorrents.log $remote_dir $local_dir

login="username" pass="Password" port="12345" portssl="12344" host="hostname" hostssl="sftp://hostname" remote_dir="~/downloads/rdy/." local_dir="/tank/media/incoming/"

login="MR123" #Your ftp username (keep the " " as you see them)

pass="MR123Pass" #Your ftp password (keep the " " as you see them)

host="[email protected]" #Your sftp or ftp address for your seedbox

trap "rm -f /tmp/synctorrent.lock" SIGINT SIGTERM if [ -e /tmp/synctorrent.lock ] then echo "Synctorrent is running already." exit 1 else touch /tmp/synctorrent.lock

Below is security that works for my seedbox

Adjust chmod or delete the lines if you don't need them

lines which start with mirror are the seedbox folders and local folders 1st address is for Seedbox 2nd address is Unraid

Eg./Media is seedbox directory & /mnt/user/Media is for your Unraid

the --use-pget-n=5 is the amounts of parts to simultaneously download (change the 5 to what ever maxes your connection)

/usr/local/bin/lftp <<EOF set net:limit-total-rate 20000000:0

set ftp:ssl-auth TLS

set mirror:parallel-directories false set ftp:ssl-force true set ftp:ssl-protect-data true set ftp:ssl-protect-list true set net:connection-limit 4 set mirror:use-pget-n 4 set pget:min-chunk-size 100000000 set mirror:parallel-transfer-count 4 set mirror:parallel-directories false set ssl:verify-certificate off set net:connection-takeover true

open -u $login,$pass -p $port $host

open -u $login,$pass -p $portssl $hostssl

mirror -c --Remove-source-files --loop --only-missing $remote_dir $local_dir

any suggestions how to remove empty dirs?

rm -r $remote_dir

quit 0

EOF

rm -f /tmp/synctorrent.lock

trap - SIGINT SIGTERM

filebot.sh exit 0 fi


it has a few advantages over other lftp scritps i saw out there.

it will dl big files with parallel transfer and small files ( ~15mb - 100mb chunks ) with a pget limit of 4 ( u need to compile lftp with newest source to get set pget:min-chunk-size 100000000 ) ssl over sftp transferlimit of 200mbit/s Lock file with "trap "rm -f /tmp/synctorrent.lock" SIGINT SIGTERM"

/r/seedboxes Thread