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".
Here is sample -
45 * * * * /home/user/Desktop/hadoop/sqoop/sqoop_script/sqoop.sh
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
.
export SQOOP_HOME=/usr/hdp/current/sqoop-client
export PATH=$PATH:$SQOOP_HOME/bin