Linux定时任务


使用at来让某个任务定时运行

1、安装at

sudo apt install at

2、查看服务

 sudo systemctl status atd.service

如果状态是active代表atd服务已经启动,否则通过如下命令启动at

 sudo systemctl start atd.service

3、设置定时任务

at 17:00+3 #3天后的17:00运行
at> sh test.sh #运行的程序
,

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注