debian定时任务系统

xiaoxiao2025-12-31  4

cron是一个linux下的定时执行工具,可以在无需人工干预的情况下运行作业。 查看一下cron是否有自动启动 # cd /etc/rc2.d # ls -al lrwxrwxrwx 1 root root 14 Apr 13 19:29 S89cron -> ../init.d/cron 如果有上面一项就说明cron有自动启动。 如果没有,则可以自己做一个link ls -sf /init.d/cron S89cron 编辑/etc/crontab文件配置cron 下面是我的机了下的crontab # cat /etc/crontab # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) # 所以每天要执行的任务放在 /etc/cron.daily/下,每周要执行的任务放在/etc/cron.weekly下,每月要执行的任务放在/etc/cron.monthly下。 相关资源:敏捷开发V1.0.pptx
转载请注明原文地址: https://www.6miu.com/read-5041831.html

最新回复(0)