I’m trying to reduce the number of times per day my hard drive spins up from idle, to reduce the physical wear on the drive. Rather a noob here, so please bear with me. I found posts mentioning editing the crontab to increase the interval of scheduled jobs as one way of accomplishing this, and was finally able to figure out how to do so. I successfully edited it from:
I confirmed that the edit had taken place, and also that it would survive a reboot. I timed the interval between HDD spin-ups, and found that they were 10 minutes apart - not 5 minutes, and certainly not the 3 hours I was looking for. It didn’t matter whether I was on the network (thinking that an outside request may have been triggering it) or not.
When I checked the crontab today after editing it last night, I saw that it had reverted back to the every 5 minute interval. Not sure if there’s some automatic update that’s overwriting it back to default.
I installed a few apps, so I suppose one or more of those could be triggering it, but I don’t know how to check that.
Running NextcloudPi 1.35.0, with Nextcloud version 22.214.171.124
Pretty confused here, and welcome any insight and assistance. Thanks!
Thanks for the reply. I did not know about needing the leading zero - the example I found did not mention the need. I will give that a try. I appreciate the assistance!
P.S. - In the edited line I coped in my original post, that bullet symbol was actually an asterisk - not sure how that got changed when I saved the post. So I think I had it set for 3 hours, but still was missing that leading zero.
I rebooted, waiting for the next drive spinup, and started the stopwatch. Spinup to spinup was still 10 minutes on the button, so not only did the original, unedited crontab schedule of every 5 minutes not affect the time between spinups, the edit I made to “every 3 hours” also had no effect. It seems clear that there’s some other process being triggered every 10 minutes, and that this crontab may not even be active. Is there a way to check that? I thought simply saving an edited crontab activated it and started the clock running.
@Skyhooker Just as a sidenote: I wouldn’t recommend to change Nextclouds crontab to run just once every three hours. It can have unexpected side effects for Nextcloud since Nextcloud expects the cron to run every 5 minutes.
My post is not a direct answer to your question or a solution to your problem. But rather a few thoughts about whether there is a problem at all, that needs to be solved, or whether you are even increasing the problem with your idea.
If you ask me, the only good reason to idle a disk in a server, is for power saving. In fact there are even people that say, disks used with aggressive power saving schemes in NAS’es tend to die rather quickly.
Unfortunately, there isn’t too much public data on this issue, but I would say that frequent spinups and spindowns can stress a disk even more than if you let it spin all the time. Whether the disk will last longer over time, depends also on how often you actually access the server. If you only access the server once a week, it probably makes sense to shut down the disks for the time the server is not beeing used. If you access it several times a day, probably not.
At the end of the day it comes down to how often you use the server, whether it is worth the hassle to try getting the drive idle mode somehow working, wich most likley will come with other unwanted side effects, like others already mentioned. I tend to say it’s not.
Beside of that… Unless you have multiple TBs of data, you could just buy an SSD for the data folder of your nextcloud and use the spining drives for backups and other stuff. That’s what I would do, respectively that is what I actually do.
when you say rebooted, did you mean just the nextcloud? or the entire machine? Remember that when you make changes to crontabs, you need to restart the cron services. I achieve this by issuing “service cron restart”