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
相关推荐
BigBigHang4 分钟前
【docker】cloudbeaver的docker-compose及一些踩坑
运维·docker·容器
pengdott4 分钟前
Linux进程数据结构与组织方式深度解析
linux·运维·服务器
Java 码农5 分钟前
gitlab gitrunner springboot 多环境多分支部署 (非容器方式,使用原生linux 环境)
linux·spring boot·gitlab
小快说网安18 分钟前
等保测评通过后,如何持续满足安全运维要求?
运维·安全·网络安全·等保测评
闲过信陵饮~20 分钟前
无头服务器 + Vulkan + Docker 问题
运维·docker·容器
科技块儿20 分钟前
【需求:GDPR合规下做地域定向】解决方案:仅用IP离线库输出国家码,不存原始IP?
服务器·网络·tcp/ip
LongQ30ZZ20 分钟前
Linux的常见指令
linux·服务器
走向IT22 分钟前
vdbench在Centos系统上联机测试环境搭建
linux·运维·centos
阳宗德26 分钟前
基于CentOS Linux release 7.1实现了Oracle Database 11g R2 企业版容器化运行
linux·数据库·docker·oracle·centos
·云扬·30 分钟前
MySQL运维效率提升:实用SQL语句合集
运维·sql·mysql