标题:Linux:非特权用户使用crontab实现开机任务 出处:Felix021 时间:Fri, 23 Mar 2012 15:51:39 +0000 作者:felix021 地址:https://www.felix021.com/blog/read.php?2071 内容: 以前一直纳闷,非特权用户不能编辑 /etc/rc.local ,应该如何实现开机启动任务的功能。。 刚刚详读了下 man 5 crontab ,才知道crontab的前五个参数除了可以用分时日月周之外, 还可以用一些预定义的类型(叫做Vixie cron),其中一个特殊的就是 @reboot : 引用 Instead of the first five fields, one of eight special strings may appear: string meaning ------ ------- @reboot Run once, at startup. @yearly Run once a year, "0 0 1 1 *". ...... 也就是说,只要运行crontab -e,加入一行 @reboot /home/username/my_rc.local 就可以实现个人用户的 rc.local 啦! Generated by Bo-blog 2.1.0