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. URAL1099 Work Scheduling —— 一般图匹配带花树

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

  2. IIS application pool access desktop denied

    https://stackoverflow.com/questions/5437723/iis-apppoolidentity-and-file-system-write-access-permiss ...

  3. 强大的DataGrid组件[7]_自定义DataGrid——Silverlight学习笔记[15]

    基本知识讲解 1)两种状态 DataGrid的单元格的状态有两类,即编辑状态和非编辑状态. 在实际开发中,如果一个单元格所在的列不设为只读的话(即要求可读写),那么这个单元格就存在这两种状态.按需要, ...

  4. DGA域名可以是色情网站域名

    恶意域名指传播蠕虫.病毒和特洛伊木马或是进行诈骗.色情内容传播等不法行为的网站域名. 恶意域名指传播蠕虫.病毒和特洛伊木马或是进行诈骗.色情内容传播等不法行为的网站域名.本文面临能够的挑战,就是恶意网 ...

  5. Linux下安装Openfire 4.2.1

    1.下载安装包,下载地址:http://www.igniterealtime.org/downloads/index.jsp#openfire 2.将下载的安装包复制到linux服务器的/opt目录下 ...

  6. Ruby的一些常用全局变量

    $! latesterror message $@ locationof error $_ stringlast read by gets $. linenumber last read by int ...

  7. Mediaproxy 与 Rtpproxy

    Mediaproxy: Mediaproxy是Opensips的一个模块,它用来实现现有大多数sip客户端的自动NAT穿透.这就意味着,当使用mediaproxy模块时,不需要对NAT盒子进行任何配置 ...

  8. charCode 表示空格 实现中文对齐

    字符以及HTML实体 描述以及说明     这是我们使用最多的空格,也就是按下space键产生的空格.在HTML中,如果你用空格键产生此空格,空格是不会累加的(只算1个).要使用html实体表示才可累 ...

  9. bzoj3389

    3389: [Usaco2004 Dec]Cleaning Shifts安排值班 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 367  Solved: ...

  10. 01_传智播客iOS视频教程_课程介绍与知识点回顾

    OC语法中static关键字不能修饰属性,也不能修饰方法,只能修饰方法中的局部变量.static修饰局部变量之后把局部变量变成静态变量.当方法执行完之后这个变量不会被回收.下次再执行这个方法的时候这个 ...