Updating Feeds

This page explains various methods to update feeds with tt-rss and their caveats.

1. Synchronous update.

See ObsoleteUpdateMethods.

2. Periodical updating from crontab, using wget or GET or some other command line HTTP client. Use this method if you don't have access to PHP command line interpreter (e.g. /usr/bin/php).

* Enable DAEMON_REFRESH_ONLY in config.php. not needed anymore -fox

  • Add the following as your crontab command:
/usr/bin/wget --quiet --output-document=/dev/null 
	"http://YOUR_SITE/TTRSS_LOCATION/backend.php?op=globalUpdateFeeds&daemon=1"

Full example (see man 5 crontab for more information on the syntax):

*/30 * * * * /usr/bin/wget --output-document=/dev/null --timeout=600 "http://www.your-site.xxx/tt-rss/backend.php?op=globalUpdateFeeds&daemon=1"

3. Periodical updating from crontab, using script. Use this if you have access to PHP command line interpreter, but can't run resident background processes, e.g. your hosting doesn't allow that.

* Enable DAEMON_REFRESH_ONLY in config.php.

  • Call update-feeds.php from crontab.

Full example:

*/30 * * * * /usr/bin/php /home/user/public_html/tt-rss/update_feeds.php >/dev/null 2>&1

4. Background update daemon. Before version 1.2.20, This is the recommended way to update feeds. Please use it if you have access to PHP CLI interpreter and can run background processes.

* Enable ENABLE_UPDATE_DAEMON in config.php.

  • Start update-daemon.php in background (or under screen) which would periodically update all feeds.

Sometimes, daemon may terminate unexpectedly, so it's encouraged to either try to run it periodically from crontab (daemon uses lockfile checking, so it won't start more than one copy of itself) or like this, using while true:

while true; do /usr/bin/php ./update_daemon.php; /bin/echo "daemon exited"; /bin/sleep 10; done

5. Background update daemon (optionally with init.d script). This is the recommended way to update feeds. Please use it if you have access to PHP CLI interpreter and can run background processes.

Note: Multi-process update daemon is available since 1.2.20.

Running daemon without init.d

Run update_daemon.php (single-process) or update_daemon2.php (multi-process) using PHP cli interpreter.

$ php ./update_daemon.php

The daemon doesn't daemonize, but you can force it into background using external utility like start-stop-daemon in Debian. Or just run it under screen.

Running daemon with init.d (provided scripts might not run under your distribution of choice)

Login as root on your Tiny Tiny RSS server :

  • Enable ENABLE_UPDATE_DAEMON in config.php.
  • Install the init.d script configuration file :
    /usr/bin/wget http://tt-rss.org/trac/attachment/wiki/UpdatingFeeds/tt-rss.default?format=raw \
        --output-document=/etc/default/tt-rss
    
  • Install the init.d script and make it runnable :
    /usr/bin/wget http://tt-rss.org/trac/attachment/wiki/UpdatingFeeds/tt-rss.initd?format=raw \
        --output-document=/etc/init.d/tt-rss
    /bin/chmod +x /etc/init.d/tt-rss
    
  • If you want Tiny Tiny RSS update daemon to start when you computer start :
    /usr/sbin/update-rc.d tt-rss defaults
    

Once all this done, you can use this command line to start the update daemon :

/etc/init.d/tt-rss start

And this command line to stop the update daemon :

/etc/init.d/tt-rss stop

Attachments