2016-02-05 91 views
1

我想每周重新启动一次Raspberry PI。为此,我已将shutdown -r now添加到crontab,但这不起作用(当我检查uptime时,我得到了23天的smt)。如何每周重新启动Raspberry PI

命令我做编辑crontab

# log in as pi user via SSH 
sudo -i 
crontab -e 
# in crontab: 
0 5 * * 1 sudo shutdown -r now 

当我检查uptime现在我得到:

13:52:16 up 23 days, 21:21, 1 user, load average: 0.87, 0.92, 0.95 

PS

我跑RaspBMC

回答

2

Cron工作默认在RaspBMC中禁用。您需要激活他们下

Programs > Raspbmc Settings > System Configuration > Service Management > Cronjob Scheduler 

而作为一个侧面说明,而不是开始

sudo -i 
crontab -e 

一个新的root shell你应该做的:

sudo crontab -e 

到编辑crontab文件。