Make / allow Nextcloud Box disc sleep / spin down? chron.php?

I have the Nextcloud Box, which thanks to helpful souls here is working very well.

However, the disk seems to be constantly spinning, and I’ve been thinking of making / allowing it go to sleep for some time now (for noise and disk lifetime reasons).

I just use it to have my files available away from home and for some photos on my website, so I am the only user and it doesn’t get accessed many times a day (sometimes not at all)

I wanted to change the cron job frequency from 15 mins to something larger but I cant find cron.php to follow the method here

I have tried find / -name "cron.php" 2>/dev/null but it only finds some instances of cron.php in paths
/snap/nextcloud/173/htdocs/
/snap/nextcloud/389/htdocs/
/snap/nextcloud/136/htdocs/

However, when I used find / -name "config.php" 2>/dev/null it did return some paths but not the one where I know the config.php is (i.e. /var/snap/nextcloud/current/nextcloud/config).

So I am a bit confused about how to find files, &/or something else

I think it may be somewhere in /snap/nextcloud/current/ or /var/snap/nextcloud/current/ (from here and MariusBleum) but cant find it

Can somebody give me an idea of how to do this please?

Thanks

I have made some progress, and rather than keep editing my post, I am replying to it.

I worked out that if I replace any of the 3 numbers from the results of the find command with ‘current’ then I find the file.

e.g. my cron.php file is in /snap/nextcloud/current/htdocs

however, the cron.php file had nothing in it that resembled the instructions here

Then I found this

so I looked for nextcloud-cron and found it in /snap/nextcloud/current/bin

This has the reference to 15 mins, but since I am now digging much much deeper than I understand I did not want to change anything.

For example cron.php refers to doing something for 14 mins:
// We only ask for jobs for 14 minutes, because after 15 minutes the next
// system cron task should spawn.
$endTime = time() + 14 * 60;

So presumably if I change the 15 mins in nextcloud-cron to, say, 60 mins, then I have to change the 14 mins in cron.php to 59 mins?

Also I have no idea if other things are dependant on the 15 mins in nextcloud-cron

So, for now I will leave well alone as I am obviously well out of my depth, but if anyone can help me to stop my disk spinning via this way or any other then I would be most grateful

I decided to change the following to see what happened:

  1. in nextcloud-cron:

    while true; do
    php -c $SNAP/config/php $SNAP/htdocs/cron.php
    sleep 15m

to

while true; do
        php -c $SNAP/config/php $SNAP/htdocs/cron.php
        sleep 59m
  1. in cron.php:

    // We only ask for jobs for 14 minutes, because after 15 minutes the next
    // system cron task should spawn.
    $endTime = time() + 15 * 60;

to

// We only ask for jobs for 59 minutes, because after 60 minutes the next
// system cron task should spawn.
$endTime = time() + 59 * 60;

But when I tried editing either of these files I get the warning below:

Warning: Modifying a file which is not locked, check directory permission?

What does this mean, and can/should I ignore this warning?

Gave up and just turn it off at night!

Hi Leigh,

I have the same issue. The “Cron” cong, keep spinning the Hard Disc the whole time which is annoying, heating the box and wasting power. I tried a couple config but no luck. Did you had any progress on this?

Thanks,
C

No, it is still a bit of a bug bear to me