ftp command not found - running cron script

DingoBlue

Member
Dec 3, 2010
9
0
51
cPanel Access Level
Root Administrator
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.
 

DingoBlue

Member
Dec 3, 2010
9
0
51
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.

#!/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
 

DingoBlue

Member
Dec 3, 2010
9
0
51
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
I have SSH access both normal and Jailed.

The response with "normal" is:

[email protected] [~]# ftp
-bash: ftp: command not found
[email protected] [~]# echo $SHELL
/bin/bash

The response with Jailed is:

[email protected] [~]# echo $SHELL
/usr/local/cpanel/bin/jailshell
[email protected] [~]# ftp
-jailshell: ftp: command not found

Regards
 

DingoBlue

Member
Dec 3, 2010
9
0
51
cPanel Access Level
Root Administrator
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
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.
 

DingoBlue

Member
Dec 3, 2010
9
0
51
cPanel Access Level
Root Administrator
/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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
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.