The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ftp command not found - running cron script

Discussion in 'General Discussion' started by DingoBlue, Oct 10, 2015.

  1. DingoBlue

    DingoBlue Member

    Joined:
    Dec 3, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    I am trying run a cron command from cpanel. The script, for testing purposes is set to run every minute.

    If I change the script to run simple commands such as dir, ls, pwd it works fine and I am sent an email accordingly.

    If I try and run a script containing :

    #!/bin/sh
    pwd
    ftp -n ftp2.xxxxxx.com.au << END

    I get:

    /home/zzzzzzz
    /home/zzzzzzzz/public_html/images/weather/ftp_scripts.txt: line 3: ftp: command not found

    I can see that the ftp command in not in /bin but pwd is, so I assume that that is the issue. I could copy ftp to that directory but my question is - is that the correct way to manage the issue. It does not seem so as every cpanel user in the resellers account would have to be updated in the same way.

    Any guidance would be appreciated.
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    Can you please try to use full path of FTP in your scripts. Try with /usr/bin/ftp and let me know if you are getting same issues.
     
  3. DingoBlue

    DingoBlue Member

    Joined:
    Dec 3, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1

    #!/bin/sh
    pwd
    /usr/bin/ftp -n ftp2.xxxxx.com.au


    home/yyyyyyyyy
    /home/yyyyyyyy/public_html/images/weather/ftp_scripts.txt: line 3: /usr/bin/ftp: No such file or directory
     
  4. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    Do you have enable SSH access to your account? If yes, Please login your server with that user and provide us following command out.

    Code:
    ftp
    
    echo $SHELL
    
     
  5. DingoBlue

    DingoBlue Member

    Joined:
    Dec 3, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    I have SSH access both normal and Jailed.

    The response with "normal" is:

    canyrfsa@host [~]# ftp
    -bash: ftp: command not found
    canyrfsa@host [~]# echo $SHELL
    /bin/bash

    The response with Jailed is:

    canyrfsa@host [~]# echo $SHELL
    /usr/local/cpanel/bin/jailshell
    canyrfsa@host [~]# ftp
    -jailshell: ftp: command not found

    Regards
     
  6. DingoBlue

    DingoBlue Member

    Joined:
    Dec 3, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    If I log in to root and run "which ftp" I get "/usr/bin/ftp".
    Is there somewhere that could be stopping a cpanel cron job from getting to /usr/bin?
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Please post the output from the following command:

    Code:
    grep '' /etc/redhat-release /usr/local/cpanel/version /var/cpanel/envtype ; uname -r
    Thank you.
     
  8. DingoBlue

    DingoBlue Member

    Joined:
    Dec 3, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    /etc/redhat-release:CloudLinux Server release 6.7 (Aleksei Gubarev)
    /usr/local/cpanel/version:11.52.0.18
    /var/cpanel/envtype:xen pv
    2.6.32-531.29.2.lve1.3.11.1.el6.x86_64
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
  10. DingoBlue

    DingoBlue Member

    Joined:
    Dec 3, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Thank you for your help.

    Ticket ID is 7360615
     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    To update, the user was provided with the following document that describes how to add additional locations to the CageFS filesystem template:

    CloudLinux Documentation

    Thank you.
     
Loading...

Share This Page