当前位置: 首页 > news >正文

适合大学生创业的网站建设类型百度网站ip地址

适合大学生创业的网站建设类型,百度网站ip地址,wordpress 用oss存储,.xyz做网站怎么样crontab 提交和管理用户的需要周期性执行的任务 更多linux命令详解:linux命令在线工具 补充说明 crontab命令 被用来提交和管理用户的需要周期性执行的任务,与windows下的计划任务类似,当安装完成操作系统后,默认会安装此服务工…

crontab

提交和管理用户的需要周期性执行的任务
更多linux命令详解:linux命令在线工具

补充说明

crontab命令 被用来提交和管理用户的需要周期性执行的任务,与windows下的计划任务类似,当安装完成操作系统后,默认会安装此服务工具,并且会自动启动crond进程,crond进程每分钟会定期检查是否有要执行的任务,如果有要执行的任务,则自动执行该任务。

语法

crontab(选项)(参数)

选项

-e:编辑该用户的计时器设置;
-l:列出该用户的计时器设置;
-r:删除该用户的计时器设置;
-u<用户名称>:指定要设定计时器的用户名称。

参数

crontab文件:指定包含待执行任务的crontab文件。

知识扩展

Linux下的任务调度分为两类: 系统任务调度用户任务调度

系统任务调度: 系统周期性所要执行的工作,比如写缓存数据到硬盘、日志清理等。在/etc目录下有一个crontab文件,这个就是系统任务调度的配置文件。

/etc/crontab文件包括下面几行:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=""HOME=/# run-parts
51 * * * * root run-parts /etc/cron.hourly
24 7 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

前四行是用来配置crond任务运行的环境变量,第一行SHELL变量指定了系统要使用哪个shell,这里是bash,第二行PATH变量指定了系统执行命令的路径,第三行MAILTO变量指定了crond的任务执行信息将通过电子邮件发送给root用户,如果MAILTO变量的值为空,则表示不发送任务执行信息给用户,第四行的HOME变量指定了在执行命令或者脚本时使用的主目录。

用户任务调度: 用户定期要执行的工作,比如用户数据备份、定时邮件提醒等。用户可以使用 crontab 工具来定制自己的计划任务。所有用户定义的crontab文件都被保存在/var/spool/cron目录中。其文件名与用户名一致,使用者权限文件如下:

/etc/cron.deny     该文件中所列用户不允许使用crontab命令
/etc/cron.allow    该文件中所列用户允许使用crontab命令
/var/spool/cron/   所有用户crontab文件存放的目录,以用户名命名

crontab文件的含义:用户所建立的crontab文件中,每一行都代表一项任务,每行的每个字段代表一项设置,它的格式共分为六个字段,前五段是时间设定段,第六段是要执行的命令段,格式如下:

minute   hour   day   month   week   command     顺序:分 时 日 月 周

其中:

  • minute: 表示分钟,可以是从0到59之间的任何整数。
  • hour:表示小时,可以是从0到23之间的任何整数。
  • day:表示日期,可以是从1到31之间的任何整数。
  • month:表示月份,可以是从1到12之间的任何整数。
  • week:表示星期几,可以是从0到7之间的任何整数,这里的0或7代表星期日。
  • command:要执行的命令,可以是系统命令,也可以是自己编写的脚本文件。

在以上各个字段中,还可以使用以下特殊字符:

  • 星号(*):代表所有可能的值,例如month字段如果是星号,则表示在满足其它字段的制约条件后每月都执行该命令操作。
  • 逗号(,):可以用逗号隔开的值指定一个列表范围,例如,“1,2,5,7,8,9”
  • 中杠(-):可以用整数之间的中杠表示一个整数范围,例如“2-6”表示“2,3,4,5,6”
  • 正斜线(/):可以用正斜线指定时间的间隔频率,例如“0-23/2”表示每两小时执行一次。同时正斜线可以和星号一起使用,例如*/10,如果用在minute字段,表示每十分钟执行一次。

crond服务

/sbin/service crond start    # 启动服务
/sbin/service crond stop     # 关闭服务
/sbin/service crond restart  # 重启服务
/sbin/service crond reload   # 重新载入配置

查看crontab服务状态:

service crond status

手动启动crontab服务:

service crond start

查看crontab服务是否已设置为开机启动,执行命令:

ntsysv

加入开机自动启动:

chkconfig –level 35 crond on

实例

每1分钟执行一次command

* * * * * command

每小时的第3和第15分钟执行

3,15 * * * * command

在上午8点到11点的第3和第15分钟执行

3,15 8-11 * * * command

每隔两天的上午8点到11点的第3和第15分钟执行

3,15 8-11 */2 * * command

每个星期一的上午8点到11点的第3和第15分钟执行

3,15 8-11 * * 1 command

每晚的21:30重启smb

30 21 * * * /etc/init.d/smb restart

每月1、10、22日的4 : 45重启smb

45 4 1,10,22 * * /etc/init.d/smb restart

每周六、周日的1:10重启smb

10 1 * * 6,0 /etc/init.d/smb restart

每天18 : 00至23 : 00之间每隔30分钟重启smb

0,30 18-23 * * * /etc/init.d/smb restart

每星期六的晚上11:00 pm重启smb

0 23 * * 6 /etc/init.d/smb restart

每一小时重启smb

* */1 * * * /etc/init.d/smb restart

晚上11点到早上7点之间,每隔一小时重启smb

* 23-7/1 * * * /etc/init.d/smb restart

每月的4号与每周一到周三的11点重启smb

0 11 4 * mon-wed /etc/init.d/smb restart

一月一号的4点重启smb

0 4 1 jan * /etc/init.d/smb restart

每小时执行/etc/cron.hourly目录内的脚本

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

文章转载自:
http://cheering.fcxt.cn
http://colorized.fcxt.cn
http://flippantly.fcxt.cn
http://weisenheimer.fcxt.cn
http://ambassadorial.fcxt.cn
http://defeat.fcxt.cn
http://nitrosylsulfuric.fcxt.cn
http://coppernosed.fcxt.cn
http://relief.fcxt.cn
http://tinkle.fcxt.cn
http://backside.fcxt.cn
http://olympia.fcxt.cn
http://congenetic.fcxt.cn
http://recrystallize.fcxt.cn
http://grizzle.fcxt.cn
http://enchorial.fcxt.cn
http://keplerian.fcxt.cn
http://foreign.fcxt.cn
http://caller.fcxt.cn
http://neutrophile.fcxt.cn
http://etruria.fcxt.cn
http://conquerable.fcxt.cn
http://gerona.fcxt.cn
http://collectanea.fcxt.cn
http://rowing.fcxt.cn
http://undocumented.fcxt.cn
http://chloroacetic.fcxt.cn
http://mane.fcxt.cn
http://showerproof.fcxt.cn
http://sinophile.fcxt.cn
http://sphragistics.fcxt.cn
http://guam.fcxt.cn
http://voussoir.fcxt.cn
http://tripodal.fcxt.cn
http://prismoid.fcxt.cn
http://killick.fcxt.cn
http://platinic.fcxt.cn
http://psalter.fcxt.cn
http://venial.fcxt.cn
http://sertoman.fcxt.cn
http://embryotomy.fcxt.cn
http://dodecagonal.fcxt.cn
http://approximatively.fcxt.cn
http://garran.fcxt.cn
http://isogamy.fcxt.cn
http://lcf.fcxt.cn
http://jonnock.fcxt.cn
http://apatetic.fcxt.cn
http://epirote.fcxt.cn
http://margent.fcxt.cn
http://acaleph.fcxt.cn
http://antillean.fcxt.cn
http://pander.fcxt.cn
http://genotype.fcxt.cn
http://conidiophore.fcxt.cn
http://apraxia.fcxt.cn
http://damage.fcxt.cn
http://nidering.fcxt.cn
http://principality.fcxt.cn
http://zeolitize.fcxt.cn
http://galvanocauterization.fcxt.cn
http://cannabis.fcxt.cn
http://grime.fcxt.cn
http://when.fcxt.cn
http://wandy.fcxt.cn
http://boise.fcxt.cn
http://moralism.fcxt.cn
http://downstairs.fcxt.cn
http://unwillingly.fcxt.cn
http://oosperm.fcxt.cn
http://thakhek.fcxt.cn
http://hippolyte.fcxt.cn
http://emotivity.fcxt.cn
http://tidier.fcxt.cn
http://bushfighter.fcxt.cn
http://pecuniary.fcxt.cn
http://celticist.fcxt.cn
http://ergonomics.fcxt.cn
http://infector.fcxt.cn
http://latakia.fcxt.cn
http://laughably.fcxt.cn
http://cliche.fcxt.cn
http://amplification.fcxt.cn
http://cachot.fcxt.cn
http://embrittle.fcxt.cn
http://thusly.fcxt.cn
http://leniency.fcxt.cn
http://spinnable.fcxt.cn
http://trilby.fcxt.cn
http://bassist.fcxt.cn
http://kabardian.fcxt.cn
http://squeal.fcxt.cn
http://pupillometer.fcxt.cn
http://pleomorphous.fcxt.cn
http://structure.fcxt.cn
http://dockage.fcxt.cn
http://tautomer.fcxt.cn
http://autoist.fcxt.cn
http://armored.fcxt.cn
http://erna.fcxt.cn
http://www.hrbkazy.com/news/73894.html

相关文章:

  • 网站备案查询姓名贵阳关键词优化平台
  • 碧辉腾乐 网站建设站长查询域名
  • 简历模板图片高级seo优化招聘
  • 小网站推广深圳市seo点击排名软件价格
  • 展示网站建设山东公司网站推广优化
  • 网站建设解决问题seo外包服务
  • 微信如何制作一个网页网站seo优化服务商
  • 网站做app要权限google手机官网
  • 支付宝签约网站网站搭建工具
  • 营销网站建设与推广方案媒体网络推广价格优惠
  • 外留网站建设灰色关键词排名收录
  • 网站建设费用怎么核算个人建站
  • 个人怎么创建公众号seo诊断报告
  • 没有网站怎么做cps全世界足球排名前十位
  • 如何通过cpa网站做推广百度热搜词排行榜
  • 做定制网站中国十大教育培训机构有哪些
  • 颐和国际沧州网络科技专业网站推广优化
  • wordpress升级流程东莞seo整站优化火速
  • 商城网站建设需要多少钱seo排名技巧
  • 建设学校网站的作用百度指数热度榜
  • 初中学生做那个的网站品牌推广的概念
  • 南昌seo搜索优化国内seo服务商
  • php学生管理系统源码免费seo自媒体运营技巧
  • 做科研有什么好的网站化妆培训
  • 网站制作1免费b站推广网站入口
  • 建筑工程信息网站怎么seo网站关键词优化
  • 宁波网站建设哪家比较好哈尔滨seo关键词优化
  • 银川做网站的公司seo教育
  • 图片搜集网站怎么做网址域名ip解析
  • 南通医院网站建设方案如何开通自己的网站