zoukankan      html  css  js  c++  java
  • ubuntu 设置定时任务

    crontab -l  #查看详情
    crontab -e #设置定时任务
    #例子:
    *  *  *  *  *  command 
    分 时 日 月 周 命令 
    第1列表示分钟1~59 每分钟用*或者 */1表示 
    第2列表示小时1~23(0表示0点) 
    第3列表示日期1~31 
    第4列表示月份1~12 
    第5列标识号星期0~6(0表示星期天) 
    第6列要运行的命令 
    例子:
    	*/30 * * * * /home/mysql_back.sh                             #每隔30分钟执行脚本
    30 21 * * * /usr/local/etc/rc.d/lighttpd restart             #每晚的21:30重启apache。 
    45 4 1,10,22 * * /usr/local/etc/rc.d/lighttpd restart        #每月1、10、22日的4 : 45重启apache。 
    10 1 * * 6,0 /usr/local/etc/rc.d/lighttpd restart            #每周六、周日的1 : 10重启apache。 
    0,30 18-23 * * * /usr/local/etc/rc.d/lighttpd restart        #每天18 : 00至23 : 00之间每隔30分钟重启apache。 
    0 23 * * 6 /usr/local/etc/rc.d/lighttpd restart              #每星期六的11 : 00 pm重启apache。 
    0 */1 * * * /usr/local/etc/rc.d/lighttpd restart             #每一小时重启apache 
    0 23-7/1 * * * /usr/local/etc/rc.d/lighttpd restart          #晚上11点到早上7点之间,每隔一小时重启apache 
    0 11 4 * mon-wed /usr/local/etc/rc.d/lighttpd restart        #每月的4号与每周一到周三的11点重启apache 
    0 4 1 jan * /usr/local/etc/rc.d/lighttpd restart             #一月一号的4点重启apache 
    

      

  • 相关阅读:
    php 发送手机验证码
    PHP 发送邮件
    php 图形验证码
    css 把图片变成灰色
    本地配置虚拟主机
    VMware 14 激活密钥
    linux每日命令(12): nl 命令
    linux每日命令(11): cat命令
    linux每日命令(10): touch命令
    linux每日命令(9): cp命令
  • 原文地址:https://www.cnblogs.com/chen0307/p/13415156.html
Copyright © 2011-2022 走看看