ESSAY / NOTE

ubuntu配置定时任务crontab开机自动启动脚本

1、vi /home/start.sh 内容 #!/bin/bash 代码 exit 0 2、可执行权限 chmod +x start.sh 或者 chmod -R 775 start.sh crontab -e配置完成后,如何把保存并退出? <1>.Ctrl+o 写入 <2>.出现“FIile name to Write...”,输入Enter <3>.Ctrl+x 保存输出 提示“crontab:installing new crontab”表示成功 3、末尾添加 开机30秒后启动脚本 @reboot ( sleep 30 ; sh /home/start.sh ) 4、 reboot