1. crond.service

2. configuration

2.0 format

# 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

2.1 per-user

/var/spool/cron/<user_name>

2.2 system-level

/etc/crontab
/etc/cron.d/

2.3 configure to run all script in a folder

First, create a folder and put all script into it

And then, use "run-parts", 
to create a configure item in one of cron configuraiton files, like this:

01 * * * * root run-parts /etc/cron.hourly

3. How to configure a cron job

3.1 directly add conf item into

/var/spool/cron/<user_name>
/etc/crontab

3.2 create a cron conf file and put it into

/etc/cron.d/

3.3 use crontab

crontab: invalid option -- 'h' 
crontab: usage error: unrecognized option 
Usage: 
crontab [options] file 
crontab [options] 
crontab -n [hostname]

Options: 
-u <user> define user 
-e edit user's crontab 
-l list user's crontab 
-r delete user's crontab 
-i prompt before deleting 
-n <host> set host in cluster to run users' crontabs 
-c get host in cluster to run users' crontabs 
-s selinux context 
-x <mask> enable debugging

4. cron log

/var/log/cron

5. anacron

asynchrous cron

5.1 cron trigger anacron:

/etc/cron.hourly/0anacron

5.2 anacron configuraiton

/etc/anacrontab

1 5 cron.daily nice run-parts /etc/cron.daily
7 25 cron.weekly nice run-parts /etc/cron.weekly
@monthly 45 cron.monthly nice run-parts /etc/cron.monthly

/etc/cron.d/0hourly ==> anacron ==> /etc/anacrontab/ ==> cron ==> /etc/cron.daily/cron.weekly/cron.monthly

cron on Centos的更多相关文章

  1. 在CentOS 7上使用Tripwire监控和检测修改的文件

    在CentOS 7上使用Tripwire监控和检测修改的文件 Tripwire是一个免费的开源入侵检测系统(IDS). 它是用于监视和警告系统上文件更改的安全工具. Tripwire是一个功能强大的I ...

  2. ansible环境部署及常用模块总结 - 运维笔记

    一.  Ansible 介绍Ansible是一个配置管理系统configuration management system, python 语言是运维人员必须会的语言, ansible 是一个基于py ...

  3. 11.Weblogic-SSRF漏洞复现

    应为这一阵正好在学习SSRF漏洞,又苦于本人太菜没有挖到SSRF,只能复现... 先贴出很早之前央视网SSRF可窥探内网(Weblogic SSRF案例):https://www.secpulse.c ...

  4. SSRF总结

    ssrf漏洞,全称为服务端请求伪造漏洞,由于有的web应用需要实现从其它服务器上获取资源的功能,但是没有对url进行限制,导致可以构造非本意的url对内网或者其它服务器发起恶意请求.ssrf漏洞的危害 ...

  5. SaltStack--配置管理

    saltstack配置管理 Saltstack状态模块 远程执行模块的执行是过程式,而状态是对minion的一种描述和定义,管理人员不需要关系部署任务如何完成的,只需要描述minion的状态描述.它的 ...

  6. 对ansible不支持service模块的status命令进行修正

    原生的ansible不支持service.status,在Google之后,发现有人提交了一个patch,可以支持status选项.见https://github.com/ritzk/ansible- ...

  7. centos和ubuntu下使用cron设置定时任务

    1.启动cron工具[ps:使用root权限] centos启动cron两种方式 a) /etc/init.d/crond start b) service crond start ubuntu启动c ...

  8. 在CentOS 6 的cron/crontab中使用wine运行exe程序

    几个月前服务器的OS从Ubuntu 10.04转为CentOS 6.3,装好wine后手动运行shell脚本可以正常运行指定的exe程序(脚本和Ubuntu中的一样),于是就直接修改crontab定时 ...

  9. linux/centos定时任务cron

    https://www.cnblogs.com/p0st/p/9482167.html cron: crond进程 crontab修改命令 * * * * *  command parameter & ...

随机推荐

  1. Delphi全角转半角

    function ToDBC( input :String):WideString;varc:WideString;i:Integer;beginc := input;for i:=1 to Leng ...

  2. CMMI Institute Conference 2014中国大会

    我在大会上做SPD(Strategic Policy Deployment战略部署策略)的演讲,和来自各个公司的高管进行了热烈的讨论.获得好评. 有兴趣的朋友能够点击下面链接:Stratehttp:/ ...

  3. h5ai目录列表优化

    h5ai是HTTP Web服务器的现代文件索引器,专注于您的文件.目录以有吸引力的方式显示,浏览它们通过不同的视图,面包屑和树状概述增强.最初,h5ai是HTML5 Apache Index的缩写,但 ...

  4. Android系统input按键处理流程(从驱动到framework)【转】

    本文转载自:http://blog.csdn.net/jwq2011/article/details/51234811 (暂时列出提纲,后续添加具体内容) 涉及到的几个文件: 1.out/target ...

  5. 高清摄像头MIPI CSI2接口浅解【转】

    本文转载自:http://blog.csdn.net/u012075739/article/details/44672435 MIPI摄像头常见于手机.平板中,支持500万像素以上高清分辨率.它的全称 ...

  6. URAL1099 Work Scheduling —— 一般图匹配带花树

    题目链接:https://vjudge.net/problem/URAL-1099 1099. Work Scheduling Time limit: 0.5 secondMemory limit: ...

  7. C语言预处理命令总结大全 :宏定义

    C程序的源代码中可包括各种编译指令,这些指令称为预处理命令.虽然它们实际上不是C语言的一部分,但却扩展了C程序设计的环境.本节将介绍如何应用预处理程序和注释简化程序开发过程,并提高程序的可读性.ANS ...

  8. MySQL ERROR Got an error reading communication packets

    200 ? "200px" : this.width)!important;} --> 介绍 经常会在错误日志中看到这个报错,首先我们可以从show GLOBAL statu ...

  9. Log4j日志等级

    Log4j根据日志信息的重要程度,分OFF.FATAL.ERROR.WARN.INFO.DEBUG.ALL 当然再细分的话 还有 FATAL(严重错误), 但是Log4j官方建议实际实用的话,Log4 ...

  10. bzoj 2245 [SDOI2011]工作安排【最小费用最大流】

    其实不用拆点,对于每个人我们假装他是\( s[i]+1 \)个点,可以由他向T点分别连\( s[i]+1 \)条边,容量为\( t[i][j]-t[i][j-1]\),由S点向所有产品i连容量为c[i ...