Updating TTRSS feeds

Updating TTRSS feeds

The final step after getting ttrss1 up and running is to schedule a regular update of the feeds. It’s worth taking a look at the official documentation before proceeding. Trust Me.

Updating Feeds 101

The procedure update.php handles the ttrss feed updates from the PHP CLI. It supports a number of options, most of which you are unlikely to ever need to use.

Options:
–feeds – update feeds
–feedbrowser – update feedbrowser
–daemon – start single-process update daemon
–task N – create lockfile using this task id
–cleanup-tags – perform tags table maintenance
–quiet – don’t output messages to stdout
–log FILE – log messages to FILE
–indexes – recreate missing schema indexes
–update-schema – update database schema
–gen-search-idx – generate basic PostgreSQL fulltext search index
–convert-filters – convert type1 filters to type2
–force-update – force update of all feeds
–list-plugins – list all available plugins
–debug-feed N – perform debug update of feed N
–force-refetch – debug update: force refetch feed data
–force-rehash – debug update: force rehash articles
–decrypt-feeds – decrypt feed passwords
–help – show this help

If scheduling the job via cron locally, most folks seem to reference update.php

Common methods for running feed updates remotely include using public.php and backend.php.

Troubleshooting Feed Updates

1. The first thing to try if your feeds aren’t updating is to run the update.php through the CLI (if you have access to it). As it is not recommended to run as user root use the www-data context instead:

sudo -u www-data php update.php –feeds

Here’s my console output when I run the above command:

2. If the above fails try the ‘– force-update’ option, which executes the following branch of code in update.php

3. Other issues? Check out the forum2

Scheduling regular updates

Here are your options:

  1. Create a daemon process which is the recommended way to update feeds. Good article here

    If going this route you might want to create scripts for starting/stopping the daemon and also ensure the daemon starts automatically on system startup

  2. Schedule the job using cron on the box where ttrss is installed. If you don’t have access to cron use Easycron. NB: Run the job using the www-data user context
  3. Failing the above two options, there is a simple update mode available. It updates the feeds whilst you are logged in via the browser and runs a very distant 3rd – it isn’t practical unless you are using ttrss solely as a feed reader.

    Activate it by editing the following line in config.php:

I decided to schedule the update via cron locally this time around. Here’s what I did:

♦ Edited the crontab file for user www-data

♦ Added this line to the crontab file:

I can check that the cron jobs is there using the following:

How to check on the cron job output? Beyond the scope of this post. Maybe another time..

A worthy mention

Came across this gem by Dmitri Popov which I hadn’t seen anywhere before, so I’m noting it down for future reference.

wget -q -O /dev/null “http://yourserver/tt-rss/backend.php?op=globalUpdateFeeds&daemon=1”3

Logging options

Handled by LOG_DESTINATION in config.php

define(‘LOG_DESTINATION’, ‘sql’);
// Log destination to use. Possible values:
// sql (uses internal logging you can read in Preferences -> System)
// syslog – logs to system log.
// Setting this to blank uses PHP logging (usually to http server error.log).

Easycron

Easycron is a web-based service that allow you to run cron jobs via a URL. It has excellent functionality and is particularly useful if your host (I’m looking at you iPage) doesn’t allow you to run cron jobs or daemon processes.

The URL that I have successfully used to run the update script on iPage is:

http://domain.com/apps/tt-rss/public.php?op=globalUpdateFeeds&daemon=13

The free plan is quite limited, but functional. Much better, IMO, to upgrade to the Plus plan, which at twenty bucks a year isn’t going to break the bank.

The concept of engines is a type of usage metric that they have defined. TBH, I don’t really have my head wrapped around it, but feel that 4000 is plenty for most folks. To put that into perspective, I’m running about 10 cron jobs via the site and only using 115/4000 engines.

Worth pointing out that it’s important to understand Error tolerance – this refers to the number of consecutive failures after which your job will be automatically disabled, and this is the major stumbling block when it comes to the free plan (with just 2 CF you will need to constantly monitor your jobs and manually reset them.)

The job timeout is another thing to consider depending on the complexity of the scripts you are executing.

The ‘logs and predictions‘ is very useful – well the logs part anyway. An easy way to check what happened without the need to log into servers, etc.

Use the free plan as a trial and upgrade if you are happy with the service. ‘Nuff said.

Footnotes:


1. Tiny Tiny RSS v16.8 (6b06a60) © 2005-2017 Andrew Dolgov
2. Good support forum available at: https://tt-rss.org/forum/viewforum.php
3. Modify URL to target php script in the tt-rss directory appropriate to your situation.