1.atd和crond两个任务管理程序的区别
2.指定在2024/01/24?09:00将时间写入testmail.txt文件中
[root@server ~]# at 9:00 2024-1-24
warning: commands will be executed using /bin/sh
at Wed Jan 24 09:00:00 2024
at> date >> /root/testmail.txt
at> <EOT>
job 1 at Wed Jan 24 09:00:00 2024
3.指定每天凌晨4:00将该时间点之前的日志信息备份到个目录下(/ar/log/messages),备份后日志文件名显示格式logfileYY-MM-DD HH-MM
[root@server ~]# mkdir /backup
[root@server ~]# vim /etc/crontab
0 4 * * * root /bin/cp /var/log/messages /backup/logfile`date +\%Y-\%m-\%d \%H-\%M`