Linux 下定时任务crontab的备忘

查看定时任务的状态: service crond status
查看定时任务列表:crontab -l
编辑定时任务:crontab -e
可以指定编辑某用户的定时任务:crontab -u oracle -e
定时任务的写法:

# 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 executed

如果定时任务本身已经定义到某个用户下了,例如使用 crontab -u oracle -e来编辑定时任务(该任务由oracle用户执行),那么在定义任务内容时,“user-name”处就不用再写执行的用户了。

猜你喜欢

转载自blog.csdn.net/ezgame/article/details/83045789