Linux Shell Code

Source: Internet
Author: User

1#! /bin/Bash2 3#/python2292/cnedmp/etlscript/cnedmp_etl_v1.0/Testhis4load_path=$ (CD $ (dirname$0);pwd)5#/python2292/cnedmp/etlscript/cnedmp_etl_v1.06deploy_path=$ (CD $ (dirname$LOAD _path);pwd)7#/python2292/cnedmp/Etlscript8base_path=$ (CD"$ (dirname"$DEPLOY _path")";pwd)9#/python2292/cnedmpTenmain_path=$ (CD"$ (dirname"$BASE _path")";pwd) One  Afile_landing= $DEPLOY _path'/file_landing.sh' -load_hdfs= $DEPLOY _path'/load_hdfs.sh' -Load_hive= $DEPLOY _path'/load_hive.sh' theLanding_path= $MAIN _path'/landing/' -jar_file= $DEPLOY _path'/dailydata-1.0-snapshot.jar' -ini_file= $DEPLOY _path'/cnedmp_etl.ini' -log_file= $DEPLOY _path'/shellrun.log' +  -coding='GB2312' +  A#Funtion forLog at functionlogging () { -logtime=$ (Date+"%y-%m-%d%T") -     Echo "$logTime $" - } -  -  in Source $INI _file -  to CD $LOAD _path + RM-R DataSpace - mkdirDataSpace the CD DataSpace *ziplist=$ (Cat$LOAD _path/ziplist.txt) $Logging INFO"Get zip file list $ziplist"Panax Notoginseng  forZipnameinch$ziplist -  Do theLogging INFO"-------------------handling ZipFile $zipname----------------------------" +     CP/home/infra1/jason/datafiles/$zipname. Afoldername=$ (Echo$zipname |awk-F.'{print $}') the     Echo$foldername +     mkdir$foldername -     Unzip-D./$foldername $zipname $ CD $foldername $partition=$foldername -filelist=$ (Cat$LOAD _path/filelist.txt) -Logging INFO"Get file list $filelist" the      forFileNameinch$filelist -      DoWuyi         CP$filename $LANDING _path && logging INFO"$filename copied to $LANDING _path" the      Done - CD.. Wu     SH$LOAD _path/loading_meta_init_history.SH$partition -     SH$LOAD _path/schedule_history.SH$partition About CD $LOAD _path $     RM-R $LOAD _path/DataSpace -Logging INFO"-------------------zipfile $zipname finished----------------------------" -  Done

Linux Shell Code

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.