linux 配置定时任务crontab ,开机自启动
-
开机自启动2种方式:
系统文件配置: /etc/rc.d/rc.local
定时任务:crontab -e
@reboot /opt/xx.sh -
查看定时任务
crontab -l
crontab -e执行后编辑输入@reboot /opt/xx.sh,系统会自动就存放于/var/spool/cron/目录中,文件以用户名命名。 service cron restart, 重启crontab定时任务
-
删除定时任务,全部
crontab -r
- 其它定时任务配置,格式查看cat /etc/crontab

浙公网安备 33010602011771号