惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
C
Check Point Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
K
Kaspersky official blog
博客园 - 司徒正美
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Cisco Talos Blog
Cisco Talos Blog
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网
V
V2EX - 技术
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Spread Privacy
Spread Privacy
罗磊的独立博客
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
O
OpenAI News
Jina AI
Jina AI
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
I
InfoQ
D
Docker
P
Palo Alto Networks Blog
Recorded Future
Recorded Future
M
MIT News - Artificial intelligence
博客园 - Franky
B
Blog
Scott Helme
Scott Helme
博客园 - 叶小钗
D
DataBreaches.Net

博客园 - 东方新秀

Unix系统启动时进程介绍 linux下如何用脚本实现自动ftp linux shell 自动处理ftp操作探讨 linux shell 自动处理ftp操作探讨 从Oracle数据库中导出SQL脚本 crontab无法正常运行的原因分析 手工创建Oracle数据库脚本及说明(转载) 利用Crontab实现对Oracle数据库的定时备份(转载) 一个不错了健康知识网 Oracle学习之二(用游标解决数组问题) Oracle学习 国人开发的异构数据库(Java实现的数据库) 2007年7月最受关注的20篇技术文章!(转载本文,请注明出处为CSDN) 英语在线词典 oracle帮助文档 查离有效期至多只有七天的商品的商品 Oracle分页存储过程(转) oracle日期处理 Oracle求求空间使用情况 - 东方新秀
Oracle定期运行数据
东方新秀 · 2007-09-10 · via 博客园 - 东方新秀

select to_char(add_months(last_day(sysdate) +1, -1), 'yyyymmdd'),to_char(last_day(sysdate)+1 , 'yyyymmdd') from dual ;

00 22  * *  *  

[`echo \`cal\`|awk '{print $NF}'` -eq `date +\%d`] && do-something(每月月底做两个.sh文件,以防其中一个不执行成功时,另个起作用)
假设每月最后一天的8点10分执行your_cmd_fullname,则
[code]for ((i=1;i<=12;i++));do cal $i 2004|sed '/^$\|2004\|^Su.*/d'|sed -e :a -e 'N;s/\n/ /;ta'|sed 's/.* \([0-9][0-9]\)$/\1/';done|awk '{a[$0]=sprintf("%s,%s",a[$0],NR)}END{for(i in a)printf("10 8 %d %s * your_cmd_fullname\n",i,a[i])}' days|sed 's/ ,/ /'[/code]
执行结果
[code]10 8 29 2 * your_cmd_fullname
10 8 30 4,6,9,11 * your_cmd_fullname
10 8 31 1,3,5,7,8,10,12 * your_cmd_fullname[/code]
然后加入此段代码到你的crontab中
Linux---Shell:

#!/bin/bash
today=`date +%d`
last_day=`cal | xargs | awk '{print $NF}'`
if [ "$today" != "$last_day" ]; then
    exit 1
fi
....  # other codes start from here

如何在crontab中表达每月的最后一天,用表达式不行每天执行,在要执行的

程序头做判断,不是月末则退出