Dear Prasanna,

It was nice talking to you. 

Below are the steps to execute the shell script containing hive queries through crontab/cronjob:

1) create the shell script : workflow.sh . Below will be the content:

#!/bin/bash
echo "start"
source /home/edureka/.bashrc
hive -e "show tables;"
echo "end"



2) Change the permission of workflow.sh by executing the below command:

chmod +x workflow.sh



3) Now create a crontab using crontab generator (http://crontab-generator.org/). Below is the crontab to execute workflow.sh every minute of every hour of every month of every year. 

 * * * * /home/edureka/workflow.sh > /home/edureka/cronlog.log 2>&1

4) Now execute the below command to open the crontab list and add the above crontab:

crontab -e


Now press enter --> It will open a blank file --> press i -->  paste the above crontab here like below screen-shot



Now to save press escape button 'esc' --> Now press colon + w + q  ' : wq'   
(w stands for write and q stands for quit)


Finally Press enter.  You will receive the below message:



5) Now check cronlog.log by executing the below command:

tail -f cronlog.log


As far as the warnings are concerned if you work on a later version of hive you will not receive these warning. 

I hope this will help and resolve your query. Please try this and you should be able to do so in EdurekaVm.

Please let me know if you need any further help. I will wait for your response. 

Kindly leave your feedback by clicking on any one of the below smileys.