This sounds like a good task for a cron job : http://code.tutsplus.com/tutorials/scheduling-tasks-with-cron-jobs--net-8800
the line would look like this :
*/X * * * * reboot
(if you want a reboot at every 10 minutes, replace X by 10)
Thanks for the quick response.
Edison doesn't have cron job capability built in, so I installed cronie using Alex T's repo and opkg:
opkg install cronie.
This worked fine, and I went on to write my first cron job (excitement fills the air), here it is (when i run crontab -l):
* * * * * reboot
Beautiful! This should reboot my edison every minute. Testing...
No! No reboots seem to be happening, certainly not every minute.
Any ideas here?
Thanks so much!
sorry, I did not realize cron was not installed by default.
Cronie did not work for me neither.
I decided to install fcron on my Edison, here are the steps :
- Get the program : wget ftp://ftp.seul.org/pub/fcron/fcron-3.2.0.src.tar.gz
- extract with tar -xvf
- get in the directory
- configure : ./configure --without-sendmail (Edison don't have sendmail, so disable that to make it work)
- make (answer yes to all questions)
- make install
- From there, it should be installed and be called fcron instead of cron. To add tasks, use fcrontab -e
- once you run fcron (by typing fcron in the terminal) it will run your tasks.
- To have fcron run at boot, you have to create a systemctl service. Below is a sample service (put it at /lib/systemd/system/fcron.service)
- enable your service with systemctl enable fcron
- start your service with systemctl start fcron
Description=Start fcron at boot
Sorry for the long post
I hope it will work for you!
PS : I think it will be hard for you to disable the cron job if you reboot at every minutes, maybe you should make that number 5
Thanks for the help everyone - I ended up using some systemd scripts, which are working alright. I'm still battling some bugs, but it seems like systemd is the way to go for me here.