14定时任务
定时任务 crontab
安装crontab
一般centos安装了crontab
yum install crontabs查看运行状态
systemctl status crond
systemctl enable crond
systemctl start crond查询定时任务列表
crontab -l管理定时任务列表
实际上就是一个文件
crontab -e
0 19 * * * bash /root/test.shcron表达式
# .---------------- 分钟,取值范围为 0-59
# | .------------- 小时,取值范围为 0-23
# | | .---------- 日,取值范围为 1-31
# | | | .------- 月,取值范围为 1-12
# | | | | .---- 星期,取值范围为 0-7,0 和 7 都表示星期日
# | | | | | .-- 要执行的命令
# | | | | | |
0 19 * * * bash /root/test.sh直接操作文件实现管理任务
echo "*/10 * * * * "$base_path/change_images.sh >> /var/spool/cron/root14定时任务
https://jiajun.xyz/2021/08/24/linux/14定时任务/