Cat pushfiletoremoteservice.sh
#!/bin/sh
Basedir= "' DirName $ '" arg_cnt=$#
If [$ARG _cnt-lt 3]; Then echo "Please use: $ dst_ip sshuser path_app-core" echo "Eg: $1.1.1.1 user/opt/app-core/" Exit fi
dst_ip=$1; dst_user=$2;
if [[[] $ =~. *[^/]$]]; 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 $PATH 01$files01 $DST _user@ $DST _ip: $DST _root$path01
Scp-r $PATH 02$files02 $DST _user@ $DST _ip: $DST _root$path02
Scp-r $PATH 03$files03 $DST _user@ $DST _ip: $DST _root$path03
Scp-r $PATH 04$files04 $DST _user@ $DST _ip: $DST _root$path04
Scp-r $PATH 05$files05 $DST _user@ $DST _ip: $DST _root$path05
Scp-r $PATH 06$files06 $DST _user@ $DST _ip: $DST _root$path06
Scp-r $PATH 07$files07 $DST _user@ $DST _ip: $DST _root$path07
echo "=========================================" echo "Files pushed! Please check the DST files! >> "
Ls-l $PATH 01$files01 ls-l $PATH 02$files02 ls-l $PATH 03$files03 ls-l $PATH 04$files04 ls-l $PATH 05$files05 ls-l $PATH 0 6$files06 ls-l $PATH 07$files07