ftp command not found - running cron script
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.
-
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. 0 -
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 directory0 -
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. ftp echo $SHELL
0 -
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.
ftp echo $SHELL
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 Regards0 -
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? 0 -
Hello :) Please post the output from the following command: grep '' /etc/redhat-release /usr/local/cpanel/version /var/cpanel/envtype ; uname -r
Thank you.0 -
/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 0 -
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. 0 -
Thank you for your help. Ticket ID is 7360615 0 -
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. 0 -
Hello from the future, As a workaround, I would like to say that's easy to 1. disable CageFS temporarily for a single account 2. do your FTP tasks for the Terminal end-user 3. enable CageFS again Could be useful for the one who does not have the idea? Have a good day. 0
Please sign in to leave a comment.
Comments
11 comments