一次性计划任务
yum -y install at #安装
制定单个计划任务 2分钟后执行的操作,ctrl+d 完成制定
at now + 2min
at> echo AAAAA > /root/file at> date >> /root/file
查看计划任务
atq
删除编号4的任务
atrm 4
周期性计划任务
# 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
crontable -u #指定用户 crontable -r #删除计划任务 crontab -l #查看计划任务 crontable -e #编辑计划任务 tailf /var/log/cron #查看计划任务日志 cat /var/spool/cron/root #进入此目录也可以查看用户的计划任务 vim /etc/crontab #禁止使用crontable制定计划任务,添加用户为一行将禁止使用crontable
手机扫一扫转发分享