首页 > 系统相关 >shell jfrpg上传下载文件脚本

shell jfrpg上传下载文件脚本

时间:2022-10-17 20:56:59浏览次数:53  
标签:pull tmpFile shell filePath 上传下载 vim push sh jfrpg

目录

shell jfrpg上传下载文件脚本

重名名

vim /root/.bashrc 
alias pull='sh /opt/helloWorld/pull.sh'
alias push='sh /opt/helloWorld/push.sh'
alias getandupload='sh /opt/helloWorld/getandupload.sh'
//加载配置生效
source  /root/.bashrc 

pull 下拉脚本

vim pull.sh

#!/bin/bash
filePath=$1

curl -u ecs_read:ecs_read -O  ${filePath}
tmpPath=`echo  ${filePath} | awk -F "96:8081" '{print $2}'`
tmpFile=`basename ${tmpPath}`
vim $tmpFile



//使用
pull http://192.168.48.96:8081/artifactory/ecs2_java_prod/cicd/ecs/tests/nginx.conf

push 推送脚本

vim push.sh
#!/bin/bash
filePath=$2
tmpFile=$1

curl -X PUT -u liwenchao:liwenchao -T ${tmpFile} ${filePath}


//使用
push nginx.conf http://192.168.48.96:8081/artifactory/ecs2_java_prod/cicd/ecs/tests/nginx.conf

getandupload 下拉修改后5秒上传

#!/bin/bash
filePath=$1

curl -u `cat .env` -O  ${filePath}
tmpPath=`echo  ${filePath} | awk -F "96:8081" '{print $2}'`
tmpFile=`basename ${tmpPath}`
vim $tmpFile
echo "I will upload the file after 5 seconds"
sleep 5
curl -X PUT -u `cat .env` -T ${tmpFile} ${filePath}
rm -rf  ./$tmpFile

//使用
getandupload  http://192.168.48.96:8081/artifactory/ecs2_java_prod/cicd/ecs/tests/nginx.conf

标签:pull,tmpFile,shell,filePath,上传下载,vim,push,sh,jfrpg
From: https://www.cnblogs.com/liwenchao1995/p/16800620.html

相关文章

  • HDFS文件上传下载
      一、HDFS文件上传(测试参数优先级) 1、编写源代码 @TestpublicvoidtestCopyFromLocalFile()throwsIOException,InterruptedException,URISyntaxExceptio......
  • #yyds干货盘点# 常用 Shell 分析服务器日志命令2
    9、访问次数最多的10个文件或页面catlog_file|awk'{print$11}'|sort|uniq-c|sort-nr|head-10catlog_file|awk'{print$11}'|sort|uniq-c|sort-nr|head-20awk'......
  • powershell
    将WindowsPowerShell更新到最新版本|D栈-DelftStackPowershell教程-IT宝库(itbaoku.cn)动力外壳画廊|家(powershellgallery.com)图库powershell字符集,......
  • shell编程-踩坑
    一、单引号和双引号理解单引号定义字符串所见即所得,即将单引号内的内容原样输出,或者描述为单引号里面看到的是什么就会输出什么。单引号是全引用,被单引号括起的内容......
  • Shell处理用户输入
    命令行选项定义可以修改命令的行为的单个字母,在命令行中通常带有-等字符读取命令行选项根据位置参数变量处理简单选项while循环+shiftwhile循环用于遍......
  • 在Linux系统安装及使用ShellClash的教程
    支持Debian、CentOS、Ubuntu、Armbian等绝大多数发行版Linux系统下安装及使用本脚本!使用步骤:登陆SSH使用SSH连接工具来登陆SSH,推荐putty(体积最小),JuiceSSH(支持安卓手机),或......
  • 使用Powershell/cmd提取msi安装包中的文件
    在前面的文章中介绍过如何使用msiexec这个程序执行自动化安装(https://www.cnblogs.com/zhaotianff/p/11558602.html)如果需要提取msi安装包中的文件,也可以使用msiexec程......
  • Xshell安装
    xshell破解版链接:https://pan.baidu.com/s/15A6gimNYPiSzROBjNBzImw提取码:xxk8 软件介绍Xshell6是由国外NetSarang公司开发的一款功能强大、并且非常出色......
  • 自动屏蔽DOS攻击shell脚本
    Dos攻击防范(自动屏蔽攻击IP)#!/bin/bashDATE=$(date +%d/%b/%Y:%H:%M)LOG_FILE=/usr/local/nginx/logs/demo2.access.logABNORMAL_IP=$(tail -n5000 $LOG_FILE |gr......
  • 7-shell脚本编程
    内容脚本基础格式变量运算条件测试配置用户环境流程控制函数脚本工具数组字符串处理高级变量--------------------------------正文--------------------------------------......