Shell 操作(三)——举例
2016-03-13 12:00
225 查看
每天一点上传昨天服务器产生的日志信息
(1)上传脚本的编写(upload_to_hdfs.sh)#!/bin/sh yesterday=`date --date='1 days ago' +%Y-%m-%d` hadoop fs -put /apache_logs/access_${yesterday}.log /logs
(2)crontab设置定时任务
* 1 * * * upload_to_hdfs.sh
相关文章推荐
- shell sed替换、删除文件中的某个字符串
- Shell 操作(二)
- shell 格式化输出
- shell读取文件的指定行字符串
- shell 实现统计一个网段的IP和mac对应关系并保存到文件mac.txt
- 安装apached源码包以及编写shell脚本使其启动更加方便,并且和启动系统服务相同
- linux shell命令shift
- bash for range
- Shell Zsh
- Shell 操作(一)
- /etc/profile、~/.bash_profile等几个文件的执行过程
- hbase shell基础和常用命令详解(转)
- shell 横杆 转义
- shell中for循环总结
- shell命令-awk
- shell命令-文件系统的空间信息->df du
- shell命令-printf
- shell命令-test
- shell特殊符号及变量
- shell简介