zebra1122 / snake-os

Automatically exported from code.google.com/p/snake-os
0 stars 0 forks source link

Cron job to restart NAS every 10hrs or so? #291

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
My snake-os causes transmission service to freeze after about 10 hours of 
operation. Restarting transmission doesn't help, since it freezes again almost 
immediately. Only solution seems to be a soft reboot on NAS. I wonder if 
there's a way to schedule a reboot every 10hrs so I don't need to do this 
manually?

Original issue reported on code.google.com by matti.il...@gmail.com on 3 Apr 2012 at 7:54

GoogleCodeExporter commented 8 years ago
I have the same problem. the device is frozen every few hours and the only way 
to makes it work again is by restarting it.
Is cron the only way? If so, how can I install cron on the sanke-os.
Thanks a lot!!

Original comment by magn...@gmail.com on 9 Apr 2012 at 7:29

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Fear not, I'm here to help you guys!
My NAS used to freeze randomly (sometimes it was after a few hours, sometimes 
it lasted a few days without freezing), and I realized I had to make it reboot 
every now and then to avoid this issue.
The simplest solution I came with was to simply add the following cron job:
0 5 * * * reboot

You can do that easily with the following command:
echo "0 5 * * * reboot" >> /etc/cron.d/root

Now your NAS will reboot everyday at 5:00 AM.
I have to say that my NAS never froze again after I did this.
If you flash a new firmware version, be sure to issue the command above again, 
as it will be erased when you flash.

Original comment by arionkra...@gmail.com on 18 May 2012 at 9:45

GoogleCodeExporter commented 8 years ago
Thanks a bunch, that actually worked!
Now, my NAS seems to need a reboot every 12 hours, so what line should I type 
in to make it reboot at 5pm as well?

Original comment by matti.il...@gmail.com on 20 May 2012 at 3:39

GoogleCodeExporter commented 8 years ago
Brotip: don't forget to immediately save changes and restart cron service 
(issuing the following commands) to make effective the change you made.

/usr/share/snake/config save
/etc/init.d/cron restart

Oh and I would like to thank the guys from the original thread:
http://code.google.com/p/snake-os/issues/detail?id=243
They're awesome!

To make it reboot at 5 PM as well, just issue the following command:
echo "0 17 * * * reboot" >> /etc/cron.d/root

For any other schedule configurations, I suggest you to search for cron's 
syntax on Google. That can be handy sometime.

Original comment by arionkra...@gmail.com on 23 May 2012 at 10:40

GoogleCodeExporter commented 8 years ago
Awesome, thanks a lot! Now I also understand cron a bit better.

Too bad the development of this client doesn't seem too active nowadays...

Original comment by matti.il...@gmail.com on 14 Jun 2012 at 12:13

GoogleCodeExporter commented 8 years ago
After installing pyLoad I couldn't restart my NAS every night; that would cause 
the running downloads to stop.

So I tried restarting, every night, only transmission.
And I've got to say it's working pretty well for more than a month!
Currently my status page shows "Uptime: 8 d, 32 min", and I have had no 
problems whatsoever!

In case you want to try restarting only transmission, as I did, here is the 
cron job:
0 5 * * * /opt/etc/init.d/transmission restart

Don't forget to comment out the previous command (the one that reboots the 
NAS); you can do that by simply putting a # at the beginning of its line, like 
this:
#0 5 * * * /sbin/reboot
0 5 * * * /opt/etc/init.d/transmission restart

Original comment by arionkra...@gmail.com on 1 Aug 2012 at 11:47

GoogleCodeExporter commented 8 years ago
Oups.. been meaning to reply here. 

The latest version of the transmission package let's you set up the cron by 
ticking a checkbox on the service page.

Original comment by stefansc...@googlemail.com on 14 Aug 2012 at 9:08