Crontab

From rs_wiki
Jump to: navigation, search

如何在Linux系统使用crontab代替rc.local启动ctdemo。

1. Create a file /home/ct1/ct_cron_boot.sh

2. Change its attr to 755

文件:1.png

3. Copy the script in /etc/rc.local into /home/ct1/ct_cron_boot.sh

文件:2.png

4. Comment out code in /etc/rc.local

文件:3.png

5. Type “sudo crontab –e” to open cron editor

文件:4.png

6. Add “@reboot /home/ct1/ct_cron_boot.sh”

文件:5.png

A message will appear after edit and save.

文件:6.png

7. Type “sudo reboot” to reboot

After reboot, the ct_demo is boot up

文件:7.png