[oracle@localhost ~/Estimating_db/meta_apd]$cat test.sh
#!/bin/bash
#######################################
#Author:Jianjun Zhang
#Create Data:2016-03-21
#Propose:Estimating DB
#Modify Data:
#######################################
cd /home/oracle/Estimating_db/meta_apd
source /etc/profile
source /home/oracle/.bash_profile
DATE=`date +%Y%m%d`
#同步日志数据到15并执行转换
echo "syn to 15 start:`date '+%Y-%m-%d %H:%M:%S'`"
rm -rf /home/oracle/Estimating_db/t_meta_etl_log.dmp
expdp meta_apd/metadata1234 directory=dir_estimating_db dumpfile=t_meta_etl_log.dmp tables=t_meta_etl_log query=\"WHERE log_type=\'F_BJ_T_SH\'\"
scp /home/oracle/Estimating_db/t_meta_etl_log.dmp oracle@192.168.200.15:/home/oracle/Estimating_db/
ssh oracle@192.168.200.15 "source /etc/profile;source /home/oracle/.bash_profile;DATE=`date +%Y%m%d`;cd /home/oracle/Estimating_db/;
sh /home/oracle/Estimating_db/meta_apd/meta_apd_import.sh> /home/oracle/Estimating_db/meta_apd/logs/meta_apd_import_`date +\%Y\%m\%d`.log 2>&1 &
"
#同步日志数据到15并执行转换
echo "syn to 15 end:`date '+%Y-%m-%d %H:%M:%S'`"
[oracle@localhost ~/Estimating_db/meta_apd]$sh test.sh
: No such file or directoryoracle/Estimating_db/meta_apd
: No such file or directoryle
问题文件格式不对
解决方法
vi test.sh
set ff=unix