Page 1 of 2

feeds not updating via cron or manual

Posted: 07 Jul 2013, 18:55
by theooze
Running on a fedora 18 box w/ stock rpms of php, apache, etc. i have a cronjob setup like:

*/30 * * * * apache /usr/bin/php /u01/var/www/ttrss/update.php --feeds --quiet

that seems to do nothing.

if i manually run the update as the apache user i see this (feed urls removed):

Code: Select all

php update.php --feeds
[18:43:36/25742] Lock: update.lock
[18:43:36/25742] Scheduled 14 feeds to update...
[18:43:36/25742] Base feed: http://tt-rss.org/releases.rss
[18:43:36/25742]  => 1970-01-01 00:00:00, 1 1
[18:43:38/25742]  => 1970-01-01 00:00:00, 3 2
[18:43:38/25742] Base feed: http://tt-rss.org/forum/rss.php
[18:43:38/25742]  => 1970-01-01 00:00:00, 2 1
[18:43:44/25742]  => 1970-01-01 00:00:00, 4 2
[18:43:51/25742] Base feed: http://feed1
[18:43:51/25742]  => 1970-01-01 00:00:00, 5 2
[18:43:56/25742] Base feed: http://feed2
[18:43:56/25742]  => 1970-01-01 00:00:00, 6 2
[18:43:59/25742] Base feed: http://feed3
[18:43:59/25742]  => 1970-01-01 00:00:00, 7 2
[18:44:02/25742] Base feed: http://feed4
[18:44:02/25742]  => 1970-01-01 00:00:00, 8 2
[18:44:06/25742] Base feed: http://feed5
[18:44:06/25742]  => 1970-01-01 00:00:00, 9 2
[18:44:08/25742] Base feed: http://feed6
[18:44:08/25742]  => 1970-01-01 00:00:00, 10 2
[18:44:14/25742] Base feed: http://feed7
[18:44:14/25742]  => 1970-01-01 00:00:00, 11 2
[18:44:17/25742] Base feed: http://feed8
[18:44:17/25742]  => 1970-01-01 00:00:00, 12 2
[18:44:19/25742] Base feed: http://feed9
[18:44:19/25742]  => 1970-01-01 00:00:00, 13 2
[18:44:24/25742] Base feed: http://feed10
[18:44:24/25742]  => 1970-01-01 00:00:00, 14 2
[18:44:26/25742] Base feed: http://feed11
[18:44:26/25742]  => 1970-01-01 00:00:00, 15 2
[18:44:28/25742] Base feed: http://feed12
[18:44:28/25742]  => 1970-01-01 00:00:00, 16 2
[18:44:31/25742] Sending digests, batch of max 15 users, headline limit = 1000
[18:44:31/25742] All done.
[18:44:31/25742] cache/simplepie: removed 0 files.
[18:44:31/25742] cache/images: removed 0 files.
[18:44:31/25742] cache/export: removed 0 files.
[18:44:31/25742] cache/upload: removed 0 files.
[18:44:31/25742] Removed 0 old lock files.
[18:44:31/25742] Removing old error log entries...
[18:44:31/25742] Feedbrowser updated, 2 feeds processed.
[18:44:31/25742] Purged 0 orphaned posts.
[18:44:31/25742] Cleaned 0 cached tags.


i looked through the communities at:
viewtopic.php?f=1&t=2291&p=12715&hilit=cron+feed+update#p12715
viewtopic.php?f=1&t=1915&p=9743&hilit=cron+feed+update#p9743

but they didn't help - and i can't go into simple mode as this is/will be a multi-user setup. after i installed i did get a bunch of feed updates (around 22-JUN) but i have not gotten any since then, and the sites have articles since. the default feed update interval is set to 15 min and all the feeds are set to use the default.

why are the dates showing as epoch, are the numbers after the timestamp relevant for anything and what else can i run or look at to see why this isn't working ?

Re: feeds not updating via cron or manual

Posted: 07 Jul 2013, 21:40
by vilain
remove the "apache" from the cron job. It should run the php script in cron.

I run this on my shared hosting and my MacOS desktop without problems. Although for MacOS, I did setup a launchd user-agent that works just fine.

Re: feeds not updating via cron or manual

Posted: 07 Jul 2013, 22:18
by gbcox
Here is a quick reference on crontab: http://www.adminschoice.com/crontab-quick-reference/
remember cron isn't a user, it's a daemon...and will run under the invoking user.

Setting it up as a service IMO is more elegant, and since you're running Fedora, it's pretty much cookie-cutter for you...
Since you're running apache, just remember to change the references to nginx to apache - and it will run under apache

Also, remember, there is really no more /usr/bin in Fedora... it's just /bin - /usr/bin is there for legacy purposes, but it just points to /bin

Re: feeds not updating via cron or manual

Posted: 09 Jul 2013, 12:51
by theooze
The cron entry is correct - that is from /etc/cron.d which does take a user to run under:
https://docs.fedoraproject.org/en-US/Fe ... Tasks.html

Let's take cron and the update daemon out of the picture - why aren't the feeds updating when I run the update manually ?

Re: feeds not updating via cron or manual

Posted: 09 Jul 2013, 14:50
by gbcox
No, it isn't correct. You're mis-interpreting the doc. If you want to create a crontab for another user, you use the -u parameter or login and issue the command from that other user.

Re: feeds not updating via cron or manual

Posted: 09 Jul 2013, 15:05
by theooze
ok, then why are the OS-provided files in that directory of the same format?
0hourly:
# Run the hourly jobs
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
01 * * * * root run-parts /etc/cron.hourly

sysstat
# Run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib64/sa/sa1 1 1
# 0 * * * * root /usr/lib64/sa/sa1 600 6 &
# Generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib64/sa/sa2 -A


regardless - the manual update is not working at that is the root problem. why is the manual update not working ?

Re: feeds not updating via cron or manual

Posted: 09 Jul 2013, 15:23
by gbcox
theooze wrote:regardless - the manual update is not working at that is the root problem. why is the manual update not working ?

Since you're mis-interpreting cron documentation and insisting you're correct, who knows....

Re: feeds not updating via cron or manual

Posted: 09 Jul 2013, 15:41
by theooze
dude - a MANUAL UPDATE has nothing to do w/ CRON. when i MANUALLY run the update command the feeds are not updating. why is that? what can i look at to see why the updates are not happening when i run the update manually ?

i'm also not misinterpreting the documentation. like i said above, the default, distro-provided files are of the same format. this isn't vixie-cron...

anyway - a manual update isn't working, let's focus on that.

Re: feeds not updating via cron or manual

Posted: 09 Jul 2013, 17:31
by LifeWOutMilk

Code: Select all

[[email protected] ~]# cat /etc/fedora-release
Fedora release 19 (Schrödinger’s Cat)
[[email protected] ~]# cat /etc/rc.d/rc.local
#!/bin/sh

sleep 10 && su -s /bin/sh -c \
        '/usr/bin/php /var/www/html/ttrss/update_daemon2.php --quiet' \
        apache > /var/log/update.php.log &

[[email protected] ~]#


This works, if /etc/rc.d/rc.local doesn't exist, just create it and make it executable.

Re: feeds not updating via cron or manual

Posted: 09 Jul 2013, 21:00
by LifeWOutMilk
gbcox wrote:rc.local was no longer included beginning with F16 as part of the change over to systemd. systemd method is described above.


That's why I said you have to create the file if it doesn't exist. Systemd will execute it.

Re: feeds not updating via cron or manual

Posted: 09 Jul 2013, 21:57
by sleeper_service
gbcox wrote:rc.local was no longer included beginning with F16 as part of the change over to systemd. systemd method is described above.


if you don't have anything useful to contribute, try shutting up.

the OP clearly states that when he runs update.php *BY HAND* it does not update the feeds.

clearly, then, it's not whether or not the cron job is set up properly that is the issue.

Re: feeds not updating via cron or manual

Posted: 09 Jul 2013, 22:07
by sleeper_service
theooze wrote:Running on a fedora 18 box w/ stock rpms of php, apache, etc.

if i manually run the update as the apache user i see this (feed urls removed):

Code: Select all

php update.php --feeds
[18:43:36/25742] Lock: update.lock
[18:43:36/25742] Scheduled 14 feeds to update...
[18:43:36/25742] Base feed: http://tt-rss.org/releases.rss
[18:43:36/25742]  => 1970-01-01 00:00:00, 1 1
[18:43:38/25742]  => 1970-01-01 00:00:00, 3 2
[18:43:38/25742] Base feed: http://tt-rss.org/forum/rss.php
[18:43:38/25742]  => 1970-01-01 00:00:00, 2 1
[18:43:44/25742]  => 1970-01-01 00:00:00, 4 2
[18:43:51/25742] Base feed: http://feed1
[18:43:51/25742]  => 1970-01-01 00:00:00, 5 2
[18:43:56/25742] Base feed: http://feed2
[18:43:56/25742]  => 1970-01-01 00:00:00, 6 2
[18:43:59/25742] Base feed: http://feed3
[18:43:59/25742]  => 1970-01-01 00:00:00, 7 2
[18:44:02/25742] Base feed: http://feed4
[18:44:02/25742]  => 1970-01-01 00:00:00, 8 2
[18:44:06/25742] Base feed: http://feed5
[18:44:06/25742]  => 1970-01-01 00:00:00, 9 2
[18:44:08/25742] Base feed: http://feed6
[18:44:08/25742]  => 1970-01-01 00:00:00, 10 2
[18:44:14/25742] Base feed: http://feed7
[18:44:14/25742]  => 1970-01-01 00:00:00, 11 2
[18:44:17/25742] Base feed: http://feed8
[18:44:17/25742]  => 1970-01-01 00:00:00, 12 2
[18:44:19/25742] Base feed: http://feed9
[18:44:19/25742]  => 1970-01-01 00:00:00, 13 2
[18:44:24/25742] Base feed: http://feed10
[18:44:24/25742]  => 1970-01-01 00:00:00, 14 2
[18:44:26/25742] Base feed: http://feed11
[18:44:26/25742]  => 1970-01-01 00:00:00, 15 2
[18:44:28/25742] Base feed: http://feed12
[18:44:28/25742]  => 1970-01-01 00:00:00, 16 2
[18:44:31/25742] Sending digests, batch of max 15 users, headline limit = 1000
[18:44:31/25742] All done.
[18:44:31/25742] cache/simplepie: removed 0 files.
[18:44:31/25742] cache/images: removed 0 files.
[18:44:31/25742] cache/export: removed 0 files.
[18:44:31/25742] cache/upload: removed 0 files.
[18:44:31/25742] Removed 0 old lock files.
[18:44:31/25742] Removing old error log entries...
[18:44:31/25742] Feedbrowser updated, 2 feeds processed.
[18:44:31/25742] Purged 0 orphaned posts.
[18:44:31/25742] Cleaned 0 cached tags.


i looked through the communities at:
viewtopic.php?f=1&t=2291&p=12715&hilit=cron+feed+update#p12715
viewtopic.php?f=1&t=1915&p=9743&hilit=cron+feed+update#p9743

but they didn't help - and i can't go into simple mode as this is/will be a multi-user setup. after i installed i did get a bunch of feed updates (around 22-JUN) but i have not gotten any since then, and the sites have articles since. the default feed update interval is set to 15 min and all the feeds are set to use the default.

why are the dates showing as epoch, are the numbers after the timestamp relevant for anything and what else can i run or look at to see why this isn't working ?


what version of ttrss are you using? and do you see any errors (they'd be under the system tab in preferences on an admin account, unless you configured ttrss errors to go elsewhere in the config.php).

Re: feeds not updating via cron or manual

Posted: 10 Jul 2013, 00:34
by LifeWOutMilk
gbcox wrote:
LifeWOutMilk wrote:That's why I said you have to create the file if it doesn't exist. Systemd will execute it.


System V is the legacy method. It's just as easy to skip rc.local and do it the new way.

http://fedoraproject.org/wiki/Systemd


I get that you're oh-so-proud of your little service script that took a whole 30 seconds of thought to create, but do you actually read and comprehend before you post? It's fucking systemd that executes rc.local. What part of that don't you understand?

Your service script and rc.local both accomplish the same damn thing, I don't know why you feel such an urge to be right about shit though. Shut the fuck up already.

Re: feeds not updating via cron or manual

Posted: 10 Jul 2013, 05:15
by fox
LifeWOutMilk wrote:I get that you're oh-so-proud of your little service script that took a whole 30 seconds of thought to create, but do you actually read and comprehend before you post? It's fucking systemd that executes rc.local. What part of that don't you understand?

Your service script and rc.local both accomplish the same damn thing, I don't know why you feel such an urge to be right about shit though. Shut the fuck up already.


Chill.

Re: feeds not updating via cron or manual

Posted: 10 Jul 2013, 06:52
by fox
Add define('DAEMON_EXTENDED_DEBUG', true); to config.php, run update.php --feeds and report results.