Variable not displaying while running in cron job

hi ,
While running my script individually the variable is working fine. But when i am running the same script from cron job it's displaying nothing. Can any one comment on this.

Redirect the output of the cronjob, this will give you more an idea of what is going wrong.

Cron needs the full path to commands, my guess (without seeing your script) is that a full path is needed somewhere.

19 16 * * * ksh /home/bidwhadm/cj/db_table_monitor.ksh > /home/bidwhadm/cj/db_table_monitor.log

Which does mean , there are few variables defined and are available from command line and not from cron. see if there are any exported variables.etc ( in case of oracle , you have to export $ORACLE_HOME or use $ORACLE_HOME/bin/sqlplus in the scripts instead of sqlplus directly.

Also redirect error's to the same log file as below:

 
19 16 * * * ksh /home/bidwhadm/cj/db_table_monitor.ksh > /home/bidwhadm/cj/db_table_monitor.log  2>&1

Regards
Ravi

Thanks a lot for the tip :slight_smile: