28 May, 2023

Script not working via crontab

Issue:  

I have written one script which is running fine when i ran it manually  but same script when i have scheduled  in crontab not working.


Solution: 

Source .bash_profile  in your script. It should work.

Especially when you use EOF , you must source .bash_profile in the script

. ~/.bash_profile



Useful Scripts

To Find session details using SID. set verify off col sid format 99999 col machine format a10 col program format a25 trunc col username form...