一、查看
for u in cat /etc/passwd | cut -d":" -f1
;do crontab -l -u $u;done
#所有用户的所有定时任务。
crontab -l
二、创建定时任务
crontab -e
写入定时任务 例:
0 7 * * * /bin/echo 'coffee time' >/etc/motd
(每天七点在/etc/motd文件下写入coffee time)
30 17 * * * echo "Being on sea, sail; being on land, settle" >/etc/motd
(每天五点 在/etc/motd文件中写下Being on sea, sail; being on land, settle)