在计算机的使用过程中,经常会有一些计划中的任务需要在将来的某个时间执行,linux中提供了一些方法来设定定时任务。
1、at
命令at从文件或标准输入中读取命令并在将来的一个时间执行,只执行一次。at的正常执行需要有守护进程atd:
#安装at
yum install -y at 或 apt-get install at -y
#启动守护进程
service atd start 或 systemctl start atd
#查看是否开机启动(关于systemctl请看这一篇)
chkconfig --list|grep atd 或 systemctl list-unit-files|grep