每日一shell(一)磁盘日志

请按照日期格式(xxxx-xx-xx)每日生成一个文件,例现在天生成的文件为2017-09-03.log, 而且把磁盘的使用状况写到到这个文件中。shell

## vim log.shvim

#!/bin/bash
d=`date +%F`
touch $d.log
df -hT > $d.log
crontab -e

00 * * * /bin/sh /root/shell/log.shbash

相关文章
相关标签/搜索