Linux shell pushFileToRemoteServer.sh__Linux

來源:互聯網
上載者:User

cat  pushFileToRemoteService.sh


#!/bin/sh

BASEDIR="`dirname $0`" ARG_CNT=$#
if [ $ARG_CNT -lt 3 ]; then  echo "please use: $0  dst_ip  sshUser  path_app-core"  echo "eg: $0  1.1.1.1  user  /opt/app-core/"  exit  fi
DST_IP=$1; DST_USER=$2;
if [[ "$3" =~ .*[^/]$ ]]; then  DST_ROOT=$3/; else  DST_ROOT=$3; fi
cd "$BASEDIR" DIR="`pwd`" cd - > /dev/null
# for files(5):  # gearman-client-0.0.1-SNAPSHOT.jar # gearman-common-0.0.1-SNAPSHOT.jar # kettle-core-5.3-SNAPSHOT.jar # kettle-engine-5.3-SNAPSHOT.jar # tools-quartz-0.0.1-SNAPSHOT.jar # PATH01="lib/" FILES01="[^m]*-SNAPSHOT.jar"
# for files(1):  # tools-odpsplugin-0.0.1-SNAPSHOT-odpsinput.jar # PATH02="plugins/steps/OdpsInputPlugin/" FILES02="*odpsinput.jar"
# for files(1):  # tools-odpsplugin-0.0.1-SNAPSHOT-odpsoutput.jar # PATH03="plugins/steps/OdpsOutputPlugin/" FILES03="*odpsoutput.jar"
# for files(1):  # pentaho-big-data-plugin-5.3-SNAPSHOT.jar &  # PATH04="plugins/pentaho-big-data-plugin/" FILES04="*-SNAPSHOT.jar"
# for files(1):  # pentaho-hdfs-vfs-5.3-SNAPSHOT.jar # PATH05="plugins/pentaho-big-data-plugin/hadoop-configurations/cdh52/lib/" FILES05="*hdfs-vfs-*-SNAPSHOT.jar"
# for files(1):  # pentaho-hdfs-vfs-5.3-SNAPSHOT.jar # PATH06="plugins/pentaho-big-data-plugin/hadoop-configurations/hadoop-0.2x/lib/" FILES06="*hdfs-vfs-*-SNAPSHOT.jar"
# for files(1):  # pentaho-hdfs-vfs-5.3-SNAPSHOT.jar # PATH07="plugins/pentaho-big-data-plugin/hadoop-configurations/hadoop-2.6/lib/" FILES07="*hdfs-vfs-*-SNAPSHOT.jar"
# muti files scp -r $PATH01$FILES01   $DST_USER@$DST_IP:$DST_ROOT$PATH01
scp -r $PATH02$FILES02   $DST_USER@$DST_IP:$DST_ROOT$PATH02
scp -r $PATH03$FILES03   $DST_USER@$DST_IP:$DST_ROOT$PATH03
scp -r $PATH04$FILES04   $DST_USER@$DST_IP:$DST_ROOT$PATH04
scp -r $PATH05$FILES05   $DST_USER@$DST_IP:$DST_ROOT$PATH05
scp -r $PATH06$FILES06   $DST_USER@$DST_IP:$DST_ROOT$PATH06
scp -r $PATH07$FILES07   $DST_USER@$DST_IP:$DST_ROOT$PATH07
echo " ========================================= " echo " files pushed! please check the dst files! >> "
ls -l $PATH01$FILES01 ls -l $PATH02$FILES02 ls -l $PATH03$FILES03 ls -l $PATH04$FILES04 ls -l $PATH05$FILES05 ls -l $PATH06$FILES06 ls -l $PATH07$FILES07

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.