cron on Centos
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的更多相关文章
- 在CentOS 7上使用Tripwire监控和检测修改的文件
在CentOS 7上使用Tripwire监控和检测修改的文件 Tripwire是一个免费的开源入侵检测系统(IDS). 它是用于监视和警告系统上文件更改的安全工具. Tripwire是一个功能强大的I ...
- ansible环境部署及常用模块总结 - 运维笔记
一. Ansible 介绍Ansible是一个配置管理系统configuration management system, python 语言是运维人员必须会的语言, ansible 是一个基于py ...
- 11.Weblogic-SSRF漏洞复现
应为这一阵正好在学习SSRF漏洞,又苦于本人太菜没有挖到SSRF,只能复现... 先贴出很早之前央视网SSRF可窥探内网(Weblogic SSRF案例):https://www.secpulse.c ...
- SSRF总结
ssrf漏洞,全称为服务端请求伪造漏洞,由于有的web应用需要实现从其它服务器上获取资源的功能,但是没有对url进行限制,导致可以构造非本意的url对内网或者其它服务器发起恶意请求.ssrf漏洞的危害 ...
- SaltStack--配置管理
saltstack配置管理 Saltstack状态模块 远程执行模块的执行是过程式,而状态是对minion的一种描述和定义,管理人员不需要关系部署任务如何完成的,只需要描述minion的状态描述.它的 ...
- 对ansible不支持service模块的status命令进行修正
原生的ansible不支持service.status,在Google之后,发现有人提交了一个patch,可以支持status选项.见https://github.com/ritzk/ansible- ...
- centos和ubuntu下使用cron设置定时任务
1.启动cron工具[ps:使用root权限] centos启动cron两种方式 a) /etc/init.d/crond start b) service crond start ubuntu启动c ...
- 在CentOS 6 的cron/crontab中使用wine运行exe程序
几个月前服务器的OS从Ubuntu 10.04转为CentOS 6.3,装好wine后手动运行shell脚本可以正常运行指定的exe程序(脚本和Ubuntu中的一样),于是就直接修改crontab定时 ...
- linux/centos定时任务cron
https://www.cnblogs.com/p0st/p/9482167.html cron: crond进程 crontab修改命令 * * * * * command parameter & ...
随机推荐
- 滚动条样式优化(CSS3自定义滚动条样式 -webkit-scrollbar)
有时候觉得浏览器自带的原始滚动条不是很美观,那webkit浏览器是如何自定义滚动条的呢? Webkit支持拥有overflow属性的区域,列表框,下拉菜单,textarea的滚动条自定义样式.当然,兼 ...
- import-module in $profile
$PROFILE C:\Users\clu\Documents\PowerShell\Microsoft.PowerShell_profile.ps1 Import-Module 'C:\Users\ ...
- codeforces 686C C. Robbers' watch(dfs)
题目链接: C. Robbers' watch time limit per test 2 seconds memory limit per test 256 megabytes input stan ...
- 洛谷P3778 [APIO2017]商旅——01分数规划
题目:https://www.luogu.org/problemnew/show/P3778 转化有点技巧: 其实直接关注比率的上下两项,也就是盈利和时间: 通过暴枚和 floyd 可以处理出两两点间 ...
- JEDEC标准(JESD216)S FDP对串行Flash在系统中的应用
摘要:JEDEC标准(JESD216)Serial Flash Discoverable Parameter (SFDP)[1]是在串行Flash中建立一个可供查询的描述串行Flash功能的参数表.文 ...
- 计算属性computed 与methods
你可能已经注意到我们可以通过调用表达式中的 method 来达到同样的效果: <p>Reversed message: "{{ reversedMessage() }}" ...
- 从0开始学习Hadoop(2)安装JDK以及设置SSH
安装JDK 使用ppa/源方式安装 1.添加ppa sudo add-apt-repository ppa:webupd8team/java sudo apt-get update 2.安装oracl ...
- 视图表单访问控制器操作方法的POST、GET方式对应关系
在视图中,表单默认访问方式是FormMethod.Post(不会将请求显示在地址栏中).在控制器中,操作方法不标注属性,默认为HttpGet属性.会有以下情况出现. 1.表单不指定访问方式(默认形式为 ...
- (转) SQL Server中 ldf 文件过大的解决方法
原文地址:http://blog.itpub.net/35489/viewspace-616459/ 在SQL Server中经常遇到事务日志变大的情况,除了将数据库设置为“自动收缩”外,还可以使用下 ...
- Scanner类nextLine()和next()的区别和使用方法
next()一定要读取到有效字符后才可以结束输入,对输入有效字符之前遇到的空格键.Tab键或Enter键等结束符,next()方法会自动将其去掉,只有在输入有效字符之后,next()方法才将其后输入的 ...