Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Crontab and MailArc on GForum

Quote Reply
Crontab and MailArc on GForum
I’ve set up MailArc plugin and need info on the Crontab setup.
Can I have this so the one Crontab entry runs / executes multiple queries or will I have to set this up individually?
i.e.
GForum/archive.pl --forum=1 --forum=2 --pop-user=Forum1[at]mysite.com --pop-user=Forum2[at]mysite.com

Thanks

Regards

minesite
Quote Reply
Re: [minesite] Crontab and MailArc on GForum In reply to
Hi. I would suggest making a new script, something like "run_crons.cgi", and put something like this in it;

Code:
#!/usr/bin/perl

use strict;

my @commands;
$commands[0] = "perl /full/path/to/script.cgi --options";
$commands[1] = "perl /full/path/to/script.cgi --options";
$commands[2] = "perl /full/path/to/script.cgi --options";

foreach (@commands) {
print "Running: $_ \n";
system($_);
}

print "\n\nDone!!!";

.. and then just setup one cronjob, to run the above script. Basically, this will let you run the scripts, one after another.

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Crontab and MailArc on GForum In reply to
It does help Andy, thanks.

Regards

minesite
Quote Reply
Re: [Andy] Crontab and MailArc on GForum In reply to
Spoke to soonTongue

Ran the script from the command line and the following error came up.

Global symbol "@mysite" requires explicit package name at /full/path/to/script.cgi line 4.

myname@mysite.com is the email address I need to use in the script like so:

/full/path/to/script.cgi --forum=1 --pop-host=mysite.com --pop-user=myname@mysite.com --pop-pass=password

Regards

minesite
Quote Reply
Re: [minesite] Crontab and MailArc on GForum In reply to
Simple fix :)

Either change it so it looks like;

$commands[0] = 'perl /path/to/script --opts';

Not the ' ' and not " ".

Alternativly, you could just escape the @ Smile

someone\@domain.com

Only one of these suggestions should be required (I'd recommend the first one, as it just fills in a potential bug for future commands you want to run).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Crontab and MailArc on GForum In reply to
Working perfectly, Thanks again.

Regards

minesite