#简介:
作用: 计划任务主要是做一些周期性的任务,
目前最主要的用途是定期备份数据。
分为一次性调度执行 at 循环调度执行 cron
语法格式 示例
一分钟后建立11212.txt
[root@localhost ~]# at now +1min
at> touch 12212.txt
at> <EOT>
job 8 at Wed Aug 5 20:02:00 2020
[root@localhost ~]# ls
12121 12212.txt anaconda-ks.cfg dir2 dir4 etc-gzip.tar.gz etc-xzip.tar.xz tengine-2.3.2 yongqi
1212121 123.txt dir1 dir3 etc etc.tar file1 tengine-2.3.2.tar.gz
[root@localhost ~]#
查询
[root@localhost ~]# atq
1 Wed Aug 5 14:30:00 2020 a root
[root@localhost ~]#
systemtel 命令用法
关闭程序crond
[root@localhost ~]# systemctl stop crond
[root@localhost ~]# systemctl status crond
● crond.service - Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Wed 2020-08-05 14:57:24 CST; 5h 19min ago
Process: 720 ExecStart=/usr/sbin/crond -n $CRONDARGS (code=exited, status=0/SUCCESS)
Main PID: 720 (code=exited, status=0/SUCCESS)
Aug 05 09:07:06 localhost.localdomain systemd[</