Commit e185b59a authored by sml's avatar sml

代码提交

parent 3e16f307
......@@ -3,7 +3,6 @@ package com.jz.dmp.cmdexectool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
......@@ -12,7 +11,6 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean;
import com.jz.dmp.cmdexectool.common.utils.ApplicationContextUtil;
import com.jz.dmp.cmdexectool.scheduler.service.process.ProcessService;
......
......@@ -6,19 +6,24 @@ file_suffix="${file_suffix!}"
# 要上传到hdfs的目录
des_dir=${des_dir!}
cd $src_dir
if [ $file_suffix = "" ]; then
echo "没有后缀"
filename="*"
filename=`ls -l | grep ^- | awk '{print $9}'`
else
filename="*.${file_suffix}"
filename=`ls -l | grep ^- | awk '{print $9}' | grep .${file_suffix}`
fi
# 判断 hdfs 文件夹是否存在
su hdfs -c "hdfs dfs -test -e ${des_dir}"
# 获取当前系统时间
time=`date +%Y%m%d%H%M%S`
des_dir=${r'"${des_dir}/${time}"'}
if [ $? -ne 0 ]; then
echo "====================hdfs 文件夹不存在, 自动创建======================"
su hdfs -c "hdfs dfs -mkdir -p ${des_dir}"
fi
echo "====================hdfs 文件夹不存在, 自动创建======================"
su hdfs -c "hdfs dfs -mkdir -p ${des_dir}"
su hdfs -c "hdfs dfs -put ${src_dir}/${filename} ${des_dir}/"
\ No newline at end of file
for file in ${r'${filename}'}
do
echo "正在上传hdfs的文件是: ${r'${src_dir}/${file}'}"
${r'su hdfs -c "hdfs dfs -put ${src_dir}/${file} ${des_dir}/"'}
done
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment