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
相关推荐
StarsGreen1 小时前
Linux 网络配置命令参考
linux
飞奔的瓜牛10 小时前
Nginx 生产环境运维实践:常见问题、关注要点与日常维护
运维·nginx
Eyfcom14 小时前
〖物流 SaaS 实战 02〗SaaS 租户的计费与订阅模型:从“一锤子买卖”到“按需订阅”
linux·服务器·数据库·快递系统·物流saas实战
瑞克-桑切斯15 小时前
Kubernetes 1.28 保姆级新手学习教程
运维·学习·docker·云原生·容器·kubernetes
数据库急诊室_阿哲15 小时前
一次割接后的性能复核记录:基线、样本、回滚点
运维·数据库·dba
忆挽篱笙歌16 小时前
systemV进程通信
linux·运维·服务器
飞奔的瓜牛18 小时前
Wireshark 抓包实战:呼叫中心项目中的 SIP、DTMF 与 RTP 分析
运维·wireshark
Decay__19 小时前
SQLServer 监控体系构建 —— sql_exporter + Prometheus + Grafana 全栈实战
运维·数据库·sql·mysql·架构
遇雪长安19 小时前
wslc 来了:Docker Desktop 还要留着吗?
运维·docker·容器