Mirror Gen2 - lftp?

As title say, is there a way to install lftp on this nas based on v2.x firmware?

Any alternative? I need to sync files with a remote ftp server, based on scheduled activity (check every hour).

Or can i install a different firmware on it?

5 days of life and already hacked. well, bye warranty (?) :smiley:

anyway… if anyone else wants to achieve this pain in the *** that’s how i did it.

  1. download the chrooted debian app

  2. set the chroot environment. and here is a difference not well explained: on the mirror gen2 the path is /mnt/HD/HD_a2/Nas_Prog/Debian/chroot

  3. lftp depends on some packages that are not available in the repository. i have grabbed them from these repository and installed manually using dpkg http://mwn-cdc.arsip.or.id/debian-security/pool/updates/main/b/bind9/

  • libdns-export100_9.9.5.dfsg-9+deb8u6_armhf
  • libirs-export91_9.9.5.dfsg-9+deb8u6_armhf
  • libisc-export95_9.9.5.dfsg-9+deb8u6_armhf
  • libisccfg-export90_9.9.5.dfsg-9+deb8u6_armhf
  1. you can (finally!) install lftp via apt-get install

i have adjusted my personal mirror script (different shell) but i have achieved my purpose.

Well WD, overall it’s not a bad product but you need to improve it (is it really necessary busybox?)

Well, it has been a long time since my first post.

Today i want to share with you my personal lftp script.
Feel free to test, redistribute or modify it to suit your needs.
You don’t need brackets.

Some explanations first:

  • as stated, this is based on mirror gen2
  • don’t forget to chmod + x the .sh script file!
  • search in the forum how to create a cron job. on my nas the script is launched every hour
  • the script is launched only if you have at least 30gb of free space available
  • synctorrent.lock is a simple file used to check wether there is already a download activity
  • the script check the files/folders present in a remote ftp over ssl folder (last 7 days)
  • segmented download, no parallel file download (i have encountered issues using it)
  • notify.sh was a script related to an android app (push notification)

bye :slight_smile:

#!/bin/bash

freespacestr=df -h | awk '$1=="/mnt/HD/HD_a2" {print $4}'

freespace=echo "${freespacestr%?}"

freespace=echo "${freespacestr:0:-3}"

spacestr=echo "${freespacestr: -1}"

if [ “$spacestr” == “T” ] || [ “$freespace” -gt 30 ]

then

cat <<EOF | chroot /mnt/HD/HD_a2/Nas_Prog/Debian/chroot /bin/bash

trap “rm -f /tmp/synctorrent.lock” INT TERM

if [ -e /tmp/synctorrent.lock ]

then

exit 1

_else _

touch /tmp/synctorrent.lock

lftp<<UPTOHERE

set net:limit-total-rate 0:0

set net:limit-total-max 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 10 _

set mirror:use-pget-n 10

set pget:min-chunk-size 100000000

set mirror:parallel-transfer-count 1

set mirror:parallel-directories false

set ssl:verify-certificate off

set net:connection-takeover true

open -p <port> -u <username>,<password> <address>

glob -d mirror --newer-than=now-7days -c --loop --only-missing </remote/ftp/folder> <“/local/nas/folder”>

quit 0

UPTOHERE

rm -f /tmp/synctorrent.lock

trap - INT TERM

exit 0

fi

EOF

else

bash /mnt/HD/HD_a2/script/notify.sh “Sync cancelled (free some space on the nas!)“

fi