Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Cron Job Help

Quote Reply
Cron Job Help
I'm trying to set up a cron job so folks on our forum can use the subscription notification service. I just don't seem to be able to get the syntax or right or ... well, I'm an idiot, so I really don't know the problem.

Someone told me to use this format:

/usr/bin/perl /system/path/to/your/admin/cron/subscribe.pl –send

Our path looks like this:

/guitardiner.com/cgi-bin/gforum/admin/cron/subscribe.pl –send

But ... we don't have a /usr/bin/perl path and I'm sure that is what is wrong.

We use a Gossamer server and their control panel so setting up a cron job should be a simple task ... for someone else ...

Any help from you folks?


Thanks

Steve

Visit The Guitar Diner
Quote Reply
Re: [Boomer] Cron Job Help In reply to
What operating system are you using? If you want to test the script from say a unix shell then you can just type:

./subscribe.pl --send

at the command prompt - providing the permissions are -rwxr-xr-x (ie it is executable). The call to perl is in the first line of the script so providing it finds perl it will run (and since this is all set at install time this should be ok).

Now to cron it thats your next step.

As per the instructions just put:
"0 2 * * * /path_to/gforum/admin/cron/subscribe.pl --send" in your crontab.

If you have RedHat linux might just put a command file in /etc/cron.daily that just has:
/path_to/gforum/admin/cron/subscribe.pl --send
in it. Make sure the command file is rwx-r-xr-x as well. Take a look at other scripts in /etc/cron.daily (or hourly) to see how to do it.

doug
Quote Reply
Re: [Boomer] Cron Job Help In reply to
Hi,

That path isn't right. Look in your admin panel under Setup->Paths and URL's and look at admin_rooth_path.

Take that path and go to the cron job editor and enter:

/your/admin/path/subscribe.pl --send

as the command, and set what time you want it to go out.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Cron Job Help In reply to
In Reply To:
Hi,

That path isn't right. Look in your admin panel under Setup->Paths and URL's and look at admin_rooth_path.

Take that path and go to the cron job editor and enter:

/your/admin/path/subscribe.pl --send

as the command, and set what time you want it to go out.

Cheers,

Alex


Thanks Alex! I tried your suggestion and the final path looked like this:

home/guitdin/guitardiner.com/cgi-bin/gforum/admin/subscribe.pl --send

I got a message back from the server saying:

/bin/sh: home/guitdin/guitardiner.com/cgi-bin/gforum/admin/subscribe.pl: No such file or directory

This is the same message I was getting trying my own guesses at the path!


Steve

Visit The Guitar Diner
Quote Reply
Re: [Boomer] Cron Job Help In reply to
Hi,

You are missing a leading slash. Try:

/home/guitdin/guitardiner.com/cgi-bin/gforum/admin/subscribe.pl --send

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Cron Job Help In reply to
Using your line of code, I get this emailed to me:

/bin/sh: /home/guitdin/guitardiner.com/cgi-bin/gforum/admin/subscribe.pl: No such file or directory

Thanks for your continuing help. Alex!

Steve


Visit The Guitar Diner
Quote Reply
Re: [Boomer] Cron Job Help In reply to
It should probably be

/home/guitdin/guitardiner.com/cgi-bin/gforum/admin/cron/subscribe.pl

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Cron Job Help In reply to
Ivan, thanks for the help. I'm no longer getting the error message but I'm also not getting any notifications.

For testing purposes, I set the run time for every minute, hour, day, week and month.

I also tried it with and without the "-" and "--" that Alex had preceding the "send" in the line of code.

Thanks!

Steve

Visit The Guitar Diner
Quote Reply
Re: [Boomer] Cron Job Help In reply to
Do you have any new unread posts on the board? It only sends items you haven't read so make sure you don't read them before you run subscribe!
doug
Quote Reply
Re: [dougrobb] Cron Job Help In reply to
In Reply To:
Do you have any new unread posts on the board? It only sends items you haven't read so make sure you don't read them before you run subscribe!
doug


I'm subscribed to all ten of the forums and there are hundreds of posts daily, so that shouldn't be a problem. As I said, for testing purposes I have it set to send notifications to me on a minute by minute basis.

Thanks for checking! I'm kind of a code moron, but I did figure out not to read things in order to make it work!
Wink

Just to make sure, I've just set up a dummy aacount that's not an admin or mod to see what happens.

Steve

PS: should the last part of the code line have "-" or "--" or none (-send)? I've gotten it all three ways from people.

Visit The Guitar Diner
Quote Reply
Re: [Boomer] Cron Job Help In reply to
OK I am jumping in a bit late here- and I hope I am not hijacking this thread!- but I need some clarification: we need to run a cron job for the forum to send out message to people who subscribe to threads?

I did not know this.

So we should all run this as a cron if we allow subscriptions to forums ("Let Me KNow About New Posts")
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [Boomer] Cron Job Help In reply to
In Reply To:
PS: should the last part of the code line have "-" or "--" or none (-send)? I've gotten it all three ways from people.

You can use either the long form ('--send') or the short form ('-s'). They do the same thing. The --debug option, if you add it for any reason, is the same: --debug or -d.



Yes, GForum does require a cron job to run nightly in order to send out the forum subscription e-mails. The script is located at /path/to/your/gforum/admin/cron/subscribe.pl. The output of the --help option is below:

Code:
[jagerman@cytherea cron]$ ./subscribe.pl --help

Gossamer Forum Subscription Mailer
Usage: ./subscribe.pl --send [--debug] [-f debugfile]

This script sends out the forum subscriptions. You should run this
script automatically once a night via cron, or windows scheduler.

To send the mailings, enter:

./subscribe.pl --send

To send it automatically via cron, you would add the following:

0 2 * * * /home/jagerman/projects/gforum/cgi/admin/cron/subscribe.pl --send

to your crontab. You can optionally add --debug to display
debug information. The '-f filename' option will write any
debugging messages and/or errors into the file specified.

The --send and --debug options may be shortened to -s and -d,
repectively.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com