잠토의 잠망경

[Crontab] Oracle Crontab 가동시 문제 본문

만화경

[Crontab] Oracle Crontab 가동시 문제

잠수함토끼 2020. 7. 4. 06:45

Solution

일반적으로 실행 시키면 정상적으로 동작하지만

Crontab으로 가동시키면 동작하는 않는 문제가 발생하였다.

원인은 bash 때문인데 이를 Crontab에 어떻게 적용할지 고민하다가 발견한 Solution이다.

핵심

. /etc/profile;

crontab 예시

$crontab -e

30 7 * * *  . /etc/profile; /usr/local/bin/python2.7 /data/storeDataToOracleDB.py  &  

batch File

$vi mybatch.sh

. /etc/profile; /usr/local/bin/python2.7 /data/storeDataToOracleDB.py

$crontab -e

30 7 * * * mybatch.sh
Comments