linux运维经验分享
2017年7月9日
shell习题
No Comments
aming
要求:
请按照这样的日期格式(xxxx-xx-xx)每日生成一个文件,例如今天生成的文件为)2017-07-05.log, 并且把磁盘的使用情况写到到这个文件中,(不用考虑cron,仅仅写脚本即可)
参考答案:
#! /bin/bash d=`date +%F` logfile=$d.log df -h > $logfile
shell练习题-每日生成一个文件
2017年7月9日
shell习题
No Comments
aming
要求:
请按照这样的日期格式(xxxx-xx-xx)每日生成一个文件,例如今天生成的文件为)2017-07-05.log, 并且把磁盘的使用情况写到到这个文件中,(不用考虑cron,仅仅写脚本即可)
参考答案:
shell习题