信创服务器下连接kingbase并执行SQL的脚本
.bash_profile
Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
User specific environment and startup programs
PATH=$PATH:/home/kingbase/Server/bin
export PATH
export LD_LIBRARY_PATH=/home/kingbase/Server/lib:$LD_LIBRARY_PATH
export PGPASSWORD="t2NC3~Jh[1~9;@F(O[IcPH"
/home/kingbase/Server/bin/ksql -p 54321 -d db_dzda_bingtuan -U yyfwzh -f /home/kingbase/update_status.sql
在crontab中添加任务
crontab -e
每天凌晨1点执行脚本
0 1 * * * /home/kingbase/update_status.sh >> /home/kingbase/data/update_status_nohup.out 2>&1 &