What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Help with services-start and lftp script

pyrrhus

New Around Here
First off, can someone help me with services-start? Here's the steps I've done:

1.) jffs partition is enabled and not format on restart (confirmed that files do stay after reboot)
2.) I created the file services-start via nano under jffs/scripts/
3.) the following code is to have synctorrents.sh run every hour:

Code:
#!/bin/bash

cru a synctorrents "0 * * * *  /jffs/scripts/synctorrents.sh"
4.) I reboot and run "cru l" and I don't see the file being added.

Second issue that hopefully someone with lftp knowledge can help me out with. I created a script that pulls down torrents from my seedbox but I can't get it to remove the source files. When I add the line --Remove-source-files it breaks the string and tries to download the files to /jffs/scripts/ instead of the mounted drive I want to transfer to.

Here's the working code that just transfers the data to the mounted drive:

Code:
#!/bin/bash

login=<username>
pass=<password>
host=<host>
remote_dir=/files/complete/
local_dir=/mnt/DATA/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

  lftp -u $login,$pass $host << EOF
  set ftp:ssl-allow no
  set mirror:use-pget-n 5
  mirror -c -P5 --log=synctorrents.log $remote_dir $local_dir
  quit
EOF

  rm -f /tmp/synctorrent.lock
  exit 0

fi

I tried changing
Code:
mirror -c -P5 --log=synctorrents.log $remote_dir $local_dir
to
Code:
mirror --Remove-source-files -c -P5 --log=synctorrents.log $remote_dir $local_dir
 
Replace "bash" by "sh" in your shebang. There's no bash in the firmware.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top