FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » nntp cron.php (ubuntu cron.d job)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
nntp cron.php [message #167163] Sun, 06 May 2012 14:07 Go to next message
THUFIR is currently offline  THUFIR
Messages: 21
Registered: May 2012
Karma: 0
Junior Member
From http://localhost/fudforum/adm/admjobs.php I would like to manually run the nntp cron jobs. There's a message that cron.php has yet to be run.

Is this the correct script to run to fetch nntp messages? And the correct syntax? How could I run this script manually?

thufir@dur:~$
thufir@dur:~$ cat /etc/cron.d/fud
#hmm, is this the right syntax to run this script?
1 * * * * /var/FUDforum/scripts/nntp.php 1
thufir@dur:~$

Ah, well, I did:

chmod a+x /var/FUDforum/scripts/nntp.php

and then was able to run the script as:

/var/FUDforum/scripts/nntp.php 1

from the console,but how to I tell it to get *all* the newsgroups? This command only fetches the first newsgroup.

[Updated on: Sun, 06 May 2012 14:34]

Report message to a moderator

Re: nntp cron.php [message #167165 is a reply to message #167163] Sun, 06 May 2012 17:25 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
You can configure all the groups you want to fetch in the Newsgroup Manager. Each one will have a unique identifier. For example, the second one should be:
/var/FUDforum/scripts/nntp.php 2

Alternatively:
/var/FUDforum/scripts/nntp.php my.group.name
Re: nntp cron.php [message #167166 is a reply to message #167165] Mon, 07 May 2012 00:46 Go to previous messageGo to next message
THUFIR is currently offline  THUFIR
Messages: 21
Registered: May 2012
Karma: 0
Junior Member
naudefj wrote on Sun, 06 May 2012 10:25

Alternatively:
/var/FUDforum/scripts/nntp.php my.group.name


Oh, ok. I thought there might be a master script to "fetch all" or that you could put in parameters like 1-20 meaning fetch all groups numbered 1 to 20.

thanks,

Thufir
Re: nntp cron.php [message #167179 is a reply to message #167166] Thu, 10 May 2012 13:50 Go to previous messageGo to next message
eclipsewebmaster is currently offline  eclipsewebmaster   
Messages: 46
Registered: November 2009
Location: Ottawa, Ontario, Canada
Karma: 0
Member
We created a 'sync.php' script to handle all our newsgroups (we have about 250):

$sql = "SELECT id,newsgroup FROM " . $GLOBALS['DBHOST_TBL_PREFIX'] . "nntp ORDER BY id asc";
$rs = q($sql);
while($myrow = mysql_fetch_assoc($rs)) {
    exec("/path/to/fudforum/scripts/nntp.php " . $myrow['id']);
}
Re: nntp cron.php [message #167180 is a reply to message #167166] Thu, 10 May 2012 13:51 Go to previous messageGo to next message
eclipsewebmaster is currently offline  eclipsewebmaster   
Messages: 46
Registered: November 2009
Location: Ottawa, Ontario, Canada
Karma: 0
Member
THUFIR wrote on Sun, 06 May 2012 20:46
naudefj wrote on Sun, 06 May 2012 10:25

Alternatively:
/var/FUDforum/scripts/nntp.php my.group.name


Oh, ok. I thought there might be a master script to "fetch all" or that you could put in parameters like 1-20 meaning fetch all groups numbered 1 to 20.


You could use bash for that:

for i in {1..20}; do /path/to/nntp.php $i; done
Re: nntp cron.php [message #167181 is a reply to message #167180] Thu, 10 May 2012 14:10 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Maybe we should just build it into the script and get it done with.

To fetch all:
/path/to/nntp.php

Fetch specific group:
/path/to/nntp.php my.group.name

Deprecate number substitutes (will still work, but remove from documentation):
/path/to/nntp.php 1
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: message content in database?
Next Topic: How to make a Forum with FUDforum
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 09:48:37 GMT 2024

Total time taken to generate the page: 0.02483 seconds