Loading ...
Sorry, an error occurred while loading the content.

Auto-downloading with enhanced cTorrent

Expand Messages
  • lee_alkureishi
    Hi all, I m having a little difficulty setting up enhanced cTorrent to auto-download. I found a script on this forum which sounds exactly what I need, and I
    Message 1 of 1 , Jan 22, 2008
    View Source
    • 0 Attachment
      Hi all,

      I'm having a little difficulty setting up enhanced cTorrent to
      auto-download. I found a script on this forum which sounds exactly
      what I need, and I think I've followed the instructions to the tee,
      but it still ain't working!

      Here's the script:
      ---------------------------------------------------
      # cat autorrent.sh
      #!/bin/sh
      #set -x
      #
      # Automatic Torrent Download Queue Manager
      #
      # Create a dedicated user "autorrent-user" for running this script.
      #
      # Start this script from unslung/rc.local and it will run indefinitely:
      #
      # su autorrent-user -c "sh /autorrent-root/autorrent.sh" &
      #

      getNextFile()
      {
      cd $TORRENTDIR
      TORRENTFILE_FULLPATH=`find . -maxdepth 2 -name "*.torrent" |
      head -n 1 | cut -d "/" -f 2-`
      TORRENTFILE=`find . -maxdepth 2 -name "*.torrent" | head -n 1
      | cut -d "/" -f 3-`
      }

      # Main block starts

      TORRENTDIR="/share/hdd/data/HDD_1_1_1/Public/Torrent/queue"
      WORKDIR="/share/hdd/data/HDD_1_1_1/Public/Torrent/processing"
      FINISHED_DIR="/share/hdd/data/HDD_1_1_1/Public/Torrent/done"
      CLIENT="nohup /opt/bin/enhanced-ctorrent"
      CLIENT_OPTION="-C 10 -M 40 -m40 -S localhost:980"
      while [ 1 ]; do
      getNextFile
      while [ "$TORRENTFILE" != "" ]; do
      mv "$TORRENTFILE_FULLPATH" $WORKDIR
      cd $WORKDIR
      echo $TORRENTFILE > $TORRENTDIR/Working.txt
      $CLIENT $CLIENT_OPTION "$TORRENTFILE"
      mv $WORKDIR/* $FINISHED_DIR/
      rm $TORRENTDIR/Working.txt
      getNextFile
      done
      sleep 60
      done

      # Main block ends
      #

      ----------------------------------------

      The only thing's I haven't done are to create a dedicated user and add
      it to unslung/rc.local. Instead, I'm trying to run as root and created
      the file autorrent.sh containing the script. I made this file
      executable and then run it using:

      ./autorrent.sh

      When I hit <enter>, it says:


      BusyBox v1.3.1 (2007-12-29 03:38:35 UTC) multi-call binary

      No help available.


      These two lines then keep repeating until I hit CTRL+C. nohup.out is
      no help either - it is just thousands of almost identical lines, of
      the type:

      | 11/0/190 [176/1246/1246] 5MB,0MB | 15,0K/s | 0,0K E:0,1
      / 11/0/190 [176/1246/1246] 5MB,0MB | 15,0K/s | 0,0K E:0,1
      - 11/0/190 [176/1246/1246] 5MB,0MB | 15,0K/s | 0,0K E:0,1
      \ 11/0/190 [176/1246/1246] 5MB,0MB | 15,0K/s | 0,0K E:0,1
      | 11/0/190 [176/1246/1246] 5MB,0MB | 15,0K/s | 0,0K E:0,1

      I'm guessing this is just telling me about the torrent I already have
      downloading (started manually).

      Also, is there any way to avoid this incessant logging by nohup.out?
      The file keeps growing: It's currently 71MB! I'm sure it's not
      supposed to do this, but I can't figure out how to slow it down or
      switch it off!

      All software is the most up-to-date possible, as it's all been
      installed within the last week. Please forgive my ignorance - I think
      I'm doing alright for 1 week's experience with Linux! Love the Slug!

      Best regards,

      Lee Alkureishi
    Your message has been successfully submitted and would be delivered to recipients shortly.