Linux crontab 定时任务使用

ぐ巨炮叔叔 提交于 2019-11-30 22:53:02

1、介绍

2、常用命令

2.1 /usr/bin/crontab
[root@iZrj9ihsmk4hazx5caq0zrZ app]# which crontab
/usr/bin/crontab
2.2 ls /etc/ |grep cron
[root@iZrj9ihsmk4hazx5caq0zrZ app]# ls /etc/ |grep cron
anacrontab
cron.d
cron.daily
cron.deny
cron.hourly
cron.monthly
crontab
cron.weekly
2.3 tail -f /var/log/cron
[root@iZrj9ihsmk4hazx5caq0zrZ app]# tail -f /var/log/cron 
Oct  9 19:02:05 iZuf6h1kfgutxc3el68z2lZ crontab[5561]: (root) LIST (root)
Oct  9 19:02:39 iZuf6h1kfgutxc3el68z2lZ crontab[5800]: (root) LIST (root)
Oct  9 19:02:48 iZuf6h1kfgutxc3el68z2lZ crontab[5801]: (root) REPLACE (root)
Oct  9 19:03:01 iZuf6h1kfgutxc3el68z2lZ crond[25711]: (root) RELOAD (/var/spool/cron/root)
Oct  9 19:03:05 iZuf6h1kfgutxc3el68z2lZ crontab[5803]: (root) DELETE (root)
Oct  9 19:03:46 iZuf6h1kfgutxc3el68z2lZ crontab[5807]: (root) LIST (root)
Oct  9 19:03:54 iZuf6h1kfgutxc3el68z2lZ crontab[5808]: (root) REPLACE (root)
Oct  9 19:04:01 iZuf6h1kfgutxc3el68z2lZ crond[25711]: (root) RELOAD (/var/spool/cron/root)
Oct  9 19:10:01 iZuf6h1kfgutxc3el68z2lZ CROND[5816]: (root) CMD (sh /opt/app/test.sh)
Oct  9 19:10:01 iZuf6h1kfgutxc3el68z2lZ CROND[5817]: (root) CMD (/usr/lib64/sa/sa1 1 1)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!