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. XMU 1071 圣斗士黄金十二宫(七)银河星爆 【计算几何】

    1071: 圣斗士黄金十二宫(七)银河星爆 Time Limit: 500 MS  Memory Limit: 64 MBSubmit: 193  Solved: 10[Submit][Status] ...

  2. JavaScript 图片广告自动与手动的切换

    ​1.代码 <html> <head>   <script type="text/javascript" src="jquery-1.8.j ...

  3. 并不对劲的bzoj3832: [Poi2014]Rally

    传送门-> 这题的原理看上去很神奇. 称拓扑图中入度为0的点为“起点”,出度为0的点为“终点”. 因为“起点”和“终点”可能有很多个,算起来会很麻烦,所以新建“超级起点”S,向所有点连边,“超级 ...

  4. [Usaco2015 OPEN] Palindromic Paths

    [题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=4098 [算法] 显然 , 回文路径中第i个字母的位置(x , y)必然满足 : x ...

  5. bzoj1878 [SDOI2009]HH的项链——树状数组

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1878 离线树状数组,巧妙的思路呢: 给每种项链记录一个最后出现的位置lst,根据项链最后出现 ...

  6. ==和equals()的不同点

    两者都可以用于对象的比较."=="用于比较两个对象的内存地址值(引用值)是否相等,equals()方法用于比较两个对象的内容是否一致. String str1 = new Stri ...

  7. [知识积累]python3使用xlwt时写入文档字体颜色和边框样式

    可借鉴的网址:https://www.programcreek.com/python/example/39979/xlwt.Alignment 可以直接通过pip安装xlwt 个人理解: xlwt中对 ...

  8. tomcat 配置图片虚拟路径不起作用解决办法

    最近在做一个小项目,用到了图片上传服务器,以前尝试过实现这个功能Demo,虽然基本功能没有问题,但是很不完善,当时也有在博客记录, 地址如下: http://www.jb51.net/article/ ...

  9. 洛谷 P3622 [APIO2007]动物园【状压dp】

    看成网络流建图想了好久... 实际上5个是可以状压的 设f[i][k]为到第i个围栏状态为k的方案数,因为考虑到重复,设g[i][k]记录i开始,状态为k的孩子有几个 状态转移很好想:f[j][k]= ...

  10. C# 读写text 详细讲解

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head>     & ...