编写shell脚本unload表格里的内容到指定文件里
来源:互联网 发布:大时代 知乎 编辑:程序博客网 时间:2024/06/05 21:09
$HOME/.profile
//这里是不赋值环境变量,直接引用.profile文件。
Today=`date +%Y%m%d`
//这里是给当天日期变量赋值
gjfile=khtgjmx.$Today.210000.0000.dat
khfile=khtqykh.$Today.210000.0000.dat
dbaccess gafeywk<<!
//选定数据库
unload to $gjfile select b.xybh,a.ywrq,a.cgje from yltyw_plmxb a ,yltyw_gjxyb b where a.zt='0' and a.shzt='0' and a.ywrq='$Today' and a.zcyhdm=b.gjyhdm and a.zczh=b.gjyhzh and a.zrzh=b.qyzh ;
//数据库操作语句,意思是把表格里的内容下载到gjfile文件里。
unload to $khfile select zjhm,bljg,xybh,qyzh,zhhm,blrq,gjzqlx,zjlx from yltyw_gjxyb where zt='0';
!
//关闭数据库
gzip -f $gjfile;
gzip -f $khfile;
//压缩文件
echo "正在发送备份文件..."
echo "user gafe gafe" >ftp.tmp
echo "bin" >>ftp.tmp
echo "cd /gafe/ftpdata" >>ftp.tmp
echo "put $gjwjm.gz" >>ftp.tmp
echo "put $khwjm.gz" >>ftp.tmp
echo "bye" >>ftp.tmp
ftp -i -n 168.31.63.233 <ftp.tmp
echo "Finished!"
//使用ftpdata把文件发送到java同事要取文件的服务器上。
0 0
- 编写shell脚本unload表格里的内容到指定文件里
- 编写shell脚本unload表格里的内容到指定文件里
- 备份文件的shell脚本(备份指定目录里的指定类型的文件)
- shell脚本如何判断某个文件里是否包含指定的字符?
- shell脚本里的变量
- 用命令删除某个文件里的指定内容
- ACCESS里导出子窗体内容到指定excel里
- shell读取文件夹里的文件内容并输出
- 用Shell脚本来遍历文件夹里的所有文件
- Linux里重新命名批量文件的shell脚本
- 把一个网页文件的内容导入到word里
- 把一个网页文件的内容导入到word里
- Qt将文本框的内容写到文件里
- perl编写unload脚本
- 把内容写到文件里
- word/excel 里的表格如何到PS里使用
- linux里编写java程序定时调用shell脚本
- shell脚本里的引号简介
- Shell脚本编程学习笔记
- com编程快速入门
- Xcode 断点调试获取值为nil的问题
- C++ 的引用
- Cocoapods Undefined symbols for architecture armv7s\arm64\x86_64
- 编写shell脚本unload表格里的内容到指定文件里
- 两台Linux的通信(文件传输)
- Markup类 xml文件操作
- LintCode 138. 子数组之和
- 【微信第三方平台】授权实现及所使用的框架解析
- ArcGIS API for JavaScript开发教程系列(一)之创建地图
- mysql数据库的基本操作语句
- sftp命令
- 30. UITableViewDelegate详解