-1

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
melpomene
  • 84,125
  • 8
  • 85
  • 148
Puneet
  • 1
  • 1

1 Answers1

0

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
Jagrut Sharma
  • 4,574
  • 3
  • 14
  • 19
  • 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 03 '18 at 02: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 03 '18 at 05:40
  • 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 03 '18 at 16:59