zoukankan      html  css  js  c++  java
  • crontab

    crontab

    系统调度进程。可以使用它在每天的非高峰负荷时间段运行作业,或在一周或一月中的不同时段运行。

    at

    使用它在一个特定的时间运行一些特殊的作业,或在晚一些的非负荷高峰时
    间段或高峰负荷时间段运行。

    查看当前的任务  crontab -l

    创建一个任务

    1. crontab -e

    2. vim cronscript   and add content eg: 0-59 * * * *  echo `date` >> /home/xxx/cron.output

    关于: 0-59 * * * * 格式可参照 /etc/crontab

    cat /etc/crontab

    SHELL=/bin/bash
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    MAILTO=root

    # For details see man 4 crontabs

    # Example of job definition:
    # .---------------- minute (0 - 59)
    # |  .------------- hour (0 - 23)
    # |  |  .---------- day of month (1 - 31)
    # |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
    # |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
    # |  |  |  |  |
    # *  *  *  *  * user-name  command to be executed
    一共五个* ,在实际的例子中* 可以理解为“每”的意思

    0-59 * * * * 可以理解为每一个月的每一天,每一天中的每一个小时,每一小时的每一分钟执行。。。。操作

    删除crontab任务

    crontab -r

  • 相关阅读:
    面向对象进阶
    初识面向对象
    模块和包
    day 17递归函数
    pip命令无法使用
    Python中的iteritems()和items()
    C# 截取字符串
    Python连接Mysql数据库
    【PYTHON】 Missing parentheses in call to 'print'
    javaScript中with函数用法实例分析
  • 原文地址:https://www.cnblogs.com/cdwodm/p/5020673.html
Copyright © 2011-2022 走看看