cron job error : “sqoop command not found”


cron job error : “sqoop command not found”



After installing sqoop successfully, i wrote a script "sqoop.sh" and kept in another folder. In terminal, I am able to execute sqoop script by giving command ./sqoop.sh. It works fine. Now when i try to add a cronjob of this, error message "sqoop command not found".


./sqoop.sh



Here is sample -


45 * * * * /home/user/Desktop/hadoop/sqoop/sqoop_script/sqoop.sh




1 Answer
1



You can add the location of Sqoop's bin directory to the PATH. For example, when using bash shell, you can add these lines to the .bash_profile.


bin


PATH


bash


.bash_profile


export SQOOP_HOME=/usr/hdp/current/sqoop-client
export PATH=$PATH:$SQOOP_HOME/bin





Hi, bashrc file is already updated with SQOOP_HOME and PATH. When i am @ terminal -> user@abc:~$ sqoop help it works fine. its just when i put the command in sqoop script and script is saved at different location, i am getting this error. It seems like either i have to change my script file location or i need to make some changes in crontab file.
– Puneet
Jul 3 at 2:00






You can try editing crontab file and setting the path in it. crontab -e, and then, add PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/hdp/current/sqoop-client/bin to top of file (edit the location to include Sqoop's bin directory).
– Jagrut Sharma
Jul 3 at 5:40


crontab -e


PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/hdp/current/sqoop-client/bin


bin





Thnx it worked finally. I just added path whatever i added in Bashrc for SQOOP and JAVA home + PATH. It worked all fine.
– Puneet
Jul 3 at 16:59






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

iOS Top Alignment constraint based on screen (superview) height