Problem leech and Cron

Issue #11 invalid
renatorga created an issue

Hi, Im using Leech on my nas dlink 320 with alt f firmware that has entware support, I'm install ok with all dependencies my problem is I run the command leech and go ok add the torrent on transmission but I'm having some problem with Cron and I did what you say to create a log file and the error I'm getting is this

line 209: xsltproc: not found

I'm trying looking in Google but not found anything and the xsltproc is installed ok

I have look with nano the file in /usr/sbin/leech and on line 209 is just the command done

Comments (5)

  1. Aleksey Tulinov repo owner
    • changed status to open

    I'm not entirely sure why it's reporting that line. If it works from shell, then i suspect cron doesn't setup the same environment as shell does. You could try to do the following (in shell on NAS):

    xsltproc --version
    which xsltproc
    which curl
    

    If xsltproc --version works, but xsltproc and curl are in different directories, you might try to set PATH in cron like

    PATH=$PATH:/opt/bin
    */30 * * * * /usr/sbin/leech
    

    To have xsltproc in PATH. But i'm not an expert on entware really, from the description, problem seems to be in different environments in shell and cron, maybe someone from entware community knows how to run shell script from cron in the same way as shell does it.

    If you would let me know if anything suggested solves the issue, i can update troubleshooting for entware users, otherwise so far this seems like not a bug in leech.

  2. renatorga reporter

    Hi, Thanks for replying The command "xsltproc --version" works and I think the problem is the directory of xsltproc and curl

    which xsltproc "/opt/bin/xsltproc"

    which curl "/usr/bin/curl"

    I try this PATH=$PATH:/opt/bin and the error continue

    I know it's not a bug not a problem with entware just some issue with entware I appreciate if you help me

  3. Aleksey Tulinov repo owner

    Maybe $PATH isn't parsed in crontab. You could try to run in shell:

    echo $PATH
    

    Then copy shell's value of PATH to crontab like

    PATH=/usr/bin:/opt/bin
    */30 * * * * /usr/sbin/leech
    

    For leech you need paths to curl, xsltproc and probably transmission-remote (which transmission-remote) in your case. If leech complains about any command like xsltproc in error log, you could try which thatcommand and add its directory to the PATH in crontab.

    Take a look at this link for more details: https://stackoverflow.com/questions/10129381/crontab-path-and-user

  4. renatorga reporter

    Hi I solved thanks to your help thank you very much, I tried to put the PATH in the crontab but it did not work, so I created a script and I added the PATH in it, then it worked fine with the crontab calling the script Thanks again and success.

  5. Log in to comment