我写了一个shell备份表,手动可以执行,但是在crontab里无法执行,报:dbaccess not fount错误。
我的shell如下:#!/usr/bin/shmdy=`date'+%Y%m%d'`dbaccessss35_db-<<EOFunloadto/opt/informix/...
我的shell如下:
#!/usr/bin/sh
mdy=`date '+%Y%m%d'`
dbaccess ss35_db - << EOF
unload to /opt/informix/ifp_thread_$mdy.unl select * from ifp_thread;
EOF
dbaccess ss35_db - << EOF
delete from ifp_thread where create_time>(SELECT current-10 units hour FROM sysmaster:sysshmvals);
EOF
echo ifp_thread upload
在shell脚本里改变绝对路径后,提示23101 Unable to load locale categories,为什么那
我重新修改了脚本,可以正常执行了:
#!/usr/bin/sh
mdy=`date '+%Y%m%d'`
cd /opt/informix/bin
INFORMIXSERVER=ol_wps
export INFORMIXSERVER
INFORMIXDIR=/opt/informix
export INFORMIXDIR
ONCONFIG=onconfig.wps
export ONCONFIG
dbaccess eoms35_db - << EOF
unload to /opt/informix/ifp_thread_$mdy.unl select * from ifp_thread;
EOF
#
dbaccess eoms35_db - << EOF
delete from ifp_thread where create_time>(SELECT current-10 units hour FROM sysmaster:sysshmvals);
EOF
echo ifp_thread upload 展开
#!/usr/bin/sh
mdy=`date '+%Y%m%d'`
dbaccess ss35_db - << EOF
unload to /opt/informix/ifp_thread_$mdy.unl select * from ifp_thread;
EOF
dbaccess ss35_db - << EOF
delete from ifp_thread where create_time>(SELECT current-10 units hour FROM sysmaster:sysshmvals);
EOF
echo ifp_thread upload
在shell脚本里改变绝对路径后,提示23101 Unable to load locale categories,为什么那
我重新修改了脚本,可以正常执行了:
#!/usr/bin/sh
mdy=`date '+%Y%m%d'`
cd /opt/informix/bin
INFORMIXSERVER=ol_wps
export INFORMIXSERVER
INFORMIXDIR=/opt/informix
export INFORMIXDIR
ONCONFIG=onconfig.wps
export ONCONFIG
dbaccess eoms35_db - << EOF
unload to /opt/informix/ifp_thread_$mdy.unl select * from ifp_thread;
EOF
#
dbaccess eoms35_db - << EOF
delete from ifp_thread where create_time>(SELECT current-10 units hour FROM sysmaster:sysshmvals);
EOF
echo ifp_thread upload 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询