login="username" pass="Password" port="12345" portssl="12344" host="hostname" hostssl="sftp://hostname" remote_dir="~/downloads/rdy/." local_dir="/tank/media/incoming/"
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
/usr/local/bin/lftp <<EOF set net:limit-total-rate 20000000:0
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 $portssl $hostssl
mirror -c --Remove-source-files --loop --only-missing $remote_dir $local_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"