diff options
| author | 2019-10-27 12:32:36 +0100 | |
|---|---|---|
| committer | 2019-10-27 12:32:36 +0100 | |
| commit | 4b5474c87e6c1976428cff224e9a4d51deca40b9 (patch) | |
| tree | 1c9c99116b7c00cbe01748553ac3e507b04b5933 /docs | |
| parent | c39b716a70f65e1171d15d3f47f1d7d93b3866c8 (diff) | |
Add systemd configuration in documentation (#2605)
See #2561 and #2557
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/en/admins/08_FeedUpdates.md | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/docs/en/admins/08_FeedUpdates.md b/docs/en/admins/08_FeedUpdates.md index 61672a65a..981bdbb01 100644 --- a/docs/en/admins/08_FeedUpdates.md +++ b/docs/en/admins/08_FeedUpdates.md @@ -1,14 +1,18 @@ # Setting Up Automatic Feed Updating -FreshRSS updating is controlled by a script located at `./app/actualize_script.php`. Knowing this, we can create a Cron job to launch the update script. +FreshRSS is updated by the `./app/actualize_script.php` script. Knowing this, we can periodically trigger it to ensure up-to-date feeds. -**Note:** the update script will not fetch feeds more often than every twenty minutes, so there's no sense in setting the Cron job to run anymore often than that. +**Note:** the update script won't update any particular feed more often than once every twenty minutes, so it doesn't make sense to trigger it much more frequently than that. -You will need to check the Cron documentation for your specific distribution ([Debian/Ubuntu](https://help.ubuntu.com/community/CronHowto), [Red Hat/Fedora/CentOS](https://fedoraproject.org/wiki/Administration_Guide_Draft/Cron), [Slackware](https://docs.slackware.com/fr:slackbook:process_control?#cron), [Gentoo](https://wiki.gentoo.org/wiki/Cron), [Arch Linux](https://wiki.archlinux.org/index.php/Cron)...) to insure you set the Cron job correctly. +**Note:** the following examples assume that FreshRSS is installed to `/usr/share/FreshRSS`. You'll need to modify the FreshRSS path to reflect your own system. + +## Cron as a trigger + +You'll need to check the Cron documentation for your specific distribution ([Debian/Ubuntu](https://help.ubuntu.com/community/CronHowto), [Red Hat/Fedora/CentOS](https://fedoraproject.org/wiki/Administration_Guide_Draft/Cron), [Slackware](https://docs.slackware.com/fr:slackbook:process_control?#cron), [Gentoo](https://wiki.gentoo.org/wiki/Cron), [Arch Linux](https://wiki.archlinux.org/index.php/Cron) ...) to make sure you set the Cron job correctly. It's advisable that you run the Cron job as your Web server user (often `www-data`). -## Example on Debian/Ubuntu +### Example on Debian/Ubuntu To run the updater script every hour, and 10 minutes past the hour: Run `sudo crontab -e` and copy the following line into the crontab: @@ -16,4 +20,37 @@ Run `sudo crontab -e` and copy the following line into the crontab: 10 * * * * www-data php -f /usr/share/FreshRSS/app/actualize_script.php > /tmp/FreshRSS.log 2>&1 ``` -This crontab example, of course, assumes that FreshRSS is installed in `/usr/share/FreshRSS`; if you've installed it somewhere else, be sure to correct the path in your crontab entry. +## Systemd as a trigger + +Some systems can't use a Cron job, but they can use systemd. It's easy to configure it to mimic Cron's features. + +First you need to add a `freshrss.timer` file in `/etc/systemd/system/` with the following content: + +``` +[Unit] +Description=FreshRSS get new content + +[Timer] +OnBootSec=30s +OnCalendar=*:0/20 + +[Install] +WantedBy=timers.target +``` + +This timer will start 30 seconds after boot and it will trigger the service every 20 minutes. Feel free to change the configuration to better suit your needs. + +Then you need to add a `freshrss.service` file in the same directory. This will be the description of the service triggered by the aforementioned timer. + +``` +[Unit] +Description=FreshRSS get new content +Wants=freshrss.timer + +[Service] +User=www-data +Type=simple +ExecStart=/usr/bin/php /usr/share/FreshRSS/app/actualize_script.php +``` + +Finally, you need to enable the timer with `systemctl enable freshrss.timer` and reload the systemd configuration with `systemctl daeamon-reload`. |
