盒子
盒子
文章目录
  1. crontab

计划任务

crontab

# 查看root用户的计划任务
crontab -u root -l
# 查看
crontab -l
# 编辑
crontab -e

# 计划任务配置说明
cat /etc/crontab
# 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

# ---- 示例 ----
# 每十分钟执行一次
*/10 * * * * cmd
# 每小时执行一次
0 * * * * cmd
# 每天08:00点执行一次
0 8 * * * php /test/test.php > log/test.log
# 每天的10:30开始,每隔2小时重复一次
30 10-23/2 * * * cmd
# 服务管理
service crond start | stop | restart | status
# 重新载入配置
service crond reload
支持一下
扫一扫,支持一下
  • 微信扫一扫
  • 支付宝扫一扫