linuxserver / docker-freshrss

GNU General Public License v3.0
157 stars 24 forks source link

[FEAT] Changing the cronjob interval #55

Closed broizter closed 1 year ago

broizter commented 1 year ago

Is this a new feature request?

Wanted change

Currently the feeds will update every 15 minutes because of the cronjob in the container. It would be nice if this could be configured via an environment variable for example.

cat /etc/crontabs/root

# do daily/weekly/monthly maintenance
# min   hour    day     month   weekday command
*/15    *       *       *       *       run-parts /etc/periodic/15min
0       *       *       *       *       run-parts /etc/periodic/hourly
0       2       *       *       *       run-parts /etc/periodic/daily
0       3       *       *       6       run-parts /etc/periodic/weekly
0       5       1       *       *       run-parts /etc/periodic/monthly
# freshrss cronjob
*/15    *       *       *       *       /usr/bin/php /app/www/app/actualize_script.php > /tmp/FreshRSS.log 2>&1

Reason for change

To reduce CPU load on the host machine and whatever load it puts on the feeds. I'm sure it can be argued that it's negligible but for me personally there's no reason for the feeds to update that often. Once per hour or even less often is more than fine.

image

Proposed code change

No response

github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

aptalca commented 1 year ago

I'll be honest, the graph you posted had the opposite effect on me. I barely see any cpu utilization there and I don't think this justifies adding an env var for.

You can customize the container however: https://www.linuxserver.io/blog/2019-09-14-customizing-our-containers

aptalca commented 1 year ago

Oh wait, I had a senior moment. The actual crontab is in the config folder and is user customizable already.

broizter commented 1 year ago

Oh wait, I had a senior moment. The actual crontab is in the config folder and is user customizable already.

Well, I'm the one with that had a senior moment opening this feature request without realising its already possible to achieve what I wanted. My apologies!

denilsonsa commented 4 months ago

The actual crontab is in the config folder and is user customizable already.

For anyone aiming to customize the crontab, please note that #50 changed that behavior, and the crontab isn't in the config folder anymore.

In my case, not only it was a waste of CPU to run it every 15 minutes, but it was also noisy, as this specific machine has a spinning disk and I can hear the disk working for several minutes very often.

My solution/workaround:

    volumes:
      - ./config:/config
      - ./crontabs:/etc/crontabs

And then I initialize that folder with https://github.com/linuxserver/docker-freshrss/blob/master/root/etc/crontabs/abc

I haven't spent enough time to check if it worked or not. I hope it did.