• logging
#!/bin/bash                                                                                                                                                                                                                                                                               

# a small tool for logging sommething
#
# 1. read your input
# 2. save to logs file >> ~/logs/$(date +%F)
#
# if command like: logging something
# do echo something >> ~/logs/$(date +%F) cd ${HOME} || {
echo "no HOME variable!"
exit
} mkdir -p .logs logDir='.logs' if [ $# -gt 0 ] ; then
echo "$(date +%T) $@" >> $logDir/$(date +%F)
else
read -p "好记性不如烂笔头,please input info: " info
echo "$(date +%T)" $info >> $logDir/$(date +%F)
fi ## if faild, output
[ $? -eq 0 ] || echo "logging failed"
  • readlog
#!/bin/bash                                                                                                                                 

[ $# -gt 1 ] && {
echo "usage: $0 [-1]"
exit
} if [ $# -eq 0 ] ; then
date_file=$(date +%F)
else
date_file=$(date +%F --date="$1 day")
fi vim ${HOME}/.logs/$date_file

shell: logging + readlog的更多相关文章

  1. Python logger /logging

    # !/user/bin/python # -*- coding: utf-8 -*- ''' subprocess : 需要在linux平台上测试 shell logging ''' import ...

  2. the usage of linux command "expect"

    #! /usr/bin/expect -f# this script is used to practise the command "expect" #when "li ...

  3. RHive

    R + Hive = RHive 支持原创:http://blog.fens.me/nosql-r-hive/ R利剑NoSQL系列文章 之 Hive Hive介绍 Hive安装 RHive安装 RH ...

  4. Python logger 没打出行数

    # !/user/bin/python # -*- coding: utf-8 -*- ''' subprocess : 需要在linux平台上测试 shell logging ''' import ...

  5. 【转】Hive安装及使用攻略

    Posted: Jul 16, 2013 Tags: HadoophiveHiveQLsql分区表 Comments: 18 Comments Hive安装及使用攻略 让Hadoop跑在云端系列文章, ...

  6. 转】R利剑NoSQL系列文章 之 Hive

    原博文出自于: http://blog.fens.me/category/%E6%95%B0%E6%8D%AE%E5%BA%93/page/3/ 感谢! Posted: Jul 27, 2013 Ta ...

  7. Shell script for logging cpu and memory usage of a Linux process

    Shell script for logging cpu and memory usage of a Linux process http://www.unix.com/shell-programmi ...

  8. s14 第5天 时间模块 随机模块 String模块 shutil模块(文件操作) 文件压缩(zipfile和tarfile)shelve模块 XML模块 ConfigParser配置文件操作模块 hashlib散列模块 Subprocess模块(调用shell) logging模块 正则表达式模块 r字符串和转译

    时间模块 time datatime time.clock(2.7) time.process_time(3.3) 测量处理器运算时间,不包括sleep时间 time.altzone 返回与UTC时间 ...

  9. shell常用命令之curl: -w,–write-out参数详解

    顾名思义,write-out的作用就是输出点什么.curl的-w参数用于在一次完整且成功的操作后输出指定格式的内容到标准输出. 输出格式由普通字符串和任意数量的变量组成,输出变量需要按照%{varia ...

  10. Spark Shell & Spark submit

    Spark 的 shell 是一个强大的交互式数据分析工具. 1. 搭建Spark 2. 两个目录下面有可执行文件: bin  包含spark-shell 和 spark-submit sbin 包含 ...

随机推荐

  1. DeFi4-稳定币

    稳定币--稳定 是一个相对的度量指标 波动性,收益率标准差 在一个时间段内最大跌幅 Fiat,例如: 欧元.英镑的波动率为6-12% (波动本身并不能反映价格的范围 稳定币 vs 锚定币 稳定币类型 ...

  2. 给定一个整数数组nums和一个整数目标值target,请你在该数组中找出和为目标值target的那两个整数,并返回它们的数组下标。

    /** * 给定一个整数数组nums和一个整数目标值target,请你在该数组中找出和为目标值target的那两个整数,并返回它们的数组下标. * * 你可以假设每种输入只会对应一个答案.但是,数组中 ...

  3. [aac @ 0x1dd24c0] Input contains NaN/+-Inf

    ffmpeg编码pcm为aac时报错:[aac @ 0x1dd24c0] Input contains NaN/+-Inf 在./configure选项后面加上下列选项就可以 --enable-enc ...

  4. 笔记:网络IP数据包头部详解

    笔记:网络IP数据包头部详解          传了无数次,每次图片都没了,真是郁闷,这编辑器,需要改下啊,各位CSDN的大神们!!!        由于最近看了一些相关的资料想起来这篇文章,所以补充 ...

  5. [Pytorch框架] PyTorch 中文手册

    PyTorch 中文手册 书籍介绍 这是一本开源的书籍,目标是帮助那些希望和使用PyTorch进行深度学习开发和研究的朋友快速入门. 由于本人水平有限,在写此教程的时候参考了一些网上的资料,在这里对他 ...

  6. Python数据分析中 melt()函数的一些用法

    melt()函数是一个数据重塑工具,用于将宽格式数据转换为长格式数据(Unpivot a DataFrame from wide to long format, optionally leaving ...

  7. 字符串处理------Brute Force与KMP

    一,字符串的简单介绍 例:POJ1488  http://poj.org/problem?id=1488 题意:替换文本中的双引号: #include <iostream> #includ ...

  8. 2022-03-15:给定一棵树的头节点head,原本是一棵正常的树, 现在,在树上多加了一条冗余的边, 请找到这条冗余的边并返回。

    2022-03-15:给定一棵树的头节点head,原本是一棵正常的树, 现在,在树上多加了一条冗余的边, 请找到这条冗余的边并返回. 答案2022-03-15: 1.指向头,入度没有0的.入度没有2的 ...

  9. Apache Arrow DataFusion原理与架构

    本篇主要介绍了一种使用Rust语言编写的查询引擎--DataFusion,其使用了基于Arrow格式的内存模型,结合Rust语言本身的优势,达成了非常优秀的性能指标 DataFusion是一个查询引擎 ...

  10. 【工作随手记】mysql优化之1

    原SQL: SELECT p.id, p.NAME, p.idcard, p.phone, p.plate, p.FAMILY_NO FROM t_person_info p WHERE p.id I ...