码迷,mamicode.com
首页 > 系统相关 > 详细

shell日期的应用

时间:2016-05-09 22:06:19      阅读:289      评论:0      收藏:0      [点我收藏+]

标签:

 1 #!bin/bash
 2 
 3 del_table()
 4 {
 5         #月初的第一天
 6         month_first_day=`date +%Y%m01`
 7 
 8         #要删除的日期
 9         last_7day_ago=`date -d "-8day" +%Y%m%d`
10 
11         #drop table
12         table=t_focus_goods_coral_month_$last_7day_ago
13 
14         if [[ $month_first_day == $last_7day_ago ]];then
15         exit 0
16         else
17         #mysql -h 1270.0.01 -uxx -pxx -P 3307 -A focus  -e "drop table ${table}"
18         echo "${table}"
19         fi
20 }
21 
22 del_table

 

shell日期的应用

标签:

原文地址:http://www.cnblogs.com/gide/p/5475557.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!