linux 定时任务

crontab -e

在里面添加 需要定时的任务

如:

58 23 * * * bash /home/log_daochu2.sh > /home//log.log 2>/home/log_error.log

python 复制代码
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
 
# For details see man 4 crontabs
 
# 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 execute
 
#每天 每隔5,10,15,20,30分钟执行一次定时任务
*/5 * * * * root /data0/myshell/collect5m.sh
#*/10 * * * * root /data0/myshell/collect10m.sh
#*/15 * * * * root /data0/myshell/collect15m.sh
#*/20 * * * * root /data0/myshell/collect20m.sh
#*/30 * * * * root /data0/myshell/collect30m.sh
相关推荐
吉普赛的歌4 分钟前
【阿里云】ECS服务器重启需要注意的事项
运维·服务器·阿里云
无聊的小坏坏5 分钟前
基于 TCP 线程池服务器封装 HTTP 服务器:从协议解析到适配落地
服务器·tcp/ip·http
做运维的阿瑞20 分钟前
CentOS 7 停止维护后 YUM 源配置速查手册
linux·运维·centos
mc235624 分钟前
Linux 基本命令
linux
巴渝小禹26 分钟前
【Ubuntu】ubuntu虚拟机磁盘不够扩容后开机黑屏-解决方案
linux·ubuntu
老黄编程34 分钟前
08-ubuntu如何获取发行版代号
linux·运维·ubuntu
百锦再35 分钟前
第5章 所有权系统
运维·git·python·eclipse·go·github·负载均衡
草莓熊Lotso37 分钟前
Linux 权限管理进阶:从 umask 到粘滞位的深度解析
linux·运维·服务器·人工智能·ubuntu·centos·unix
尘似鹤3 小时前
linux驱动学习---有些节点不会生成platform_device,怎么访问它们
linux
iCxhust3 小时前
windows环境下在Bochs中运行Linux0.12系统
linux·运维·服务器·windows·minix