簡體   English   中英

Oozie Shell動作

[英]Oozie Shell action

我有一個oozie shell動作,該動作從HDFS txt文件中獲取輸入,但是每次我調用txt文件時,它都說目錄不存在,但它在服務器上存在。

這是我的shell腳本:

#!/bin/bash

Ingesta="MUM_APPs"
msj="'${1}'"
#alerta=`hdfs dfs -test -e  /user/inpt_red/oozie/workspace/envio_sms/EnviaSMS/Num_Alerta.txt`

while read line
 do
line=${i}
    Num=$(echo $line | cut -d '|' -f1)
    Proceso=$(echo $line | cut -d '|' -f5)

    if [ "$Proceso" == "*" ] || [ "$Proceso" == "$Ingesta" ]; then
        source /user/inpt_red/oozie/workspace/envio_sms/EnviaSMS/EnviaSMS.sh  ${Num} "'ALERTA!!  $Ingesta (`date +%d-%m-%Y` `date +%H:%M:%S`), $msj'"
    fi`enter code here`

done < <(hadoop fs -cat hdfs://mixsfwdebda01.telefonica.com/user/inpt_red/oozie/workspace/envio_sms/EnviaSMS/Num_Alerta.txt)

編輯1:

這是我得到的新錯誤:

 sh: line 17: syntax error near unexpected token `<' sh: line 17: `done < <(hadoop fs -cat hdfs://mixsfwdebda01.telefonica.com/user/inpt_red/oozie/workspace/envio_sms/EnviaSMS/Num_Alerta.txt)' Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1] log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.impl.MetricsSystemImpl). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 

另外,您可以將腳本更改為:

hadoop fs -cat hdfs://mixsfwdebda01.telefonica.com/user/inpt_red/oozie/workspace/envio_sms/EnviaSMS/Num_Alerta.txt |\
while read line; do
    echo "${line}"
    #Some Stuff
    #some more stuff
done

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM