linux的crontab的一般用法
查看当前用户的crontab列表
crontab -l
添加或编辑命令
crontab -e
删除全部命令
crontab -r
系统全局配置文件,直接编辑可以更新全局命令
/etc/crontab
常用配置
系统开机执行命令
@reboot systemctl start nginx
开机延迟执行
@reboot (sleep 1 && systemctl start nginx)
如果要放全局配置文件crontab里要加root
@reboot root (sleep 1 && systemctl start nginx)
浙公网安备 33010602011771号