9394952

导航

几句比较实用的script

Run cron jobs at last day of the month

for Linux

0 8 28-31 * * [ `date -d tomorrow +\%e` -eq 1 ] && do-something

for other Unix,BSD

0 8 28-31 * * [ `echo \`cal\` | awk '{print $NF}'` -eq 1 ] && do-something

More, run cron jobs at last workday of the month

0 8 26-31 * * root [ `echo \`cal | cut -d' ' -f2-6\` | awk '{print $NF}'` -eq `date +%e` ] && do-something

posted on 2008-01-10 16:21  9394952  阅读(110)  评论(0编辑  收藏  举报