Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Addition to Cron Event directions

Quote Reply
Addition to Cron Event directions
Hi,

Having just set up my first cron event, I thought I'd add/clarify a few things in Bobsie's most helpful instructions in the resource center.

1) In build_links.sh,
Code:
/path/to/cgi/links/admin/nph-build.cgi > /path/to/cgi/links/admin/logs/build_links.log
shows up as two lines in the instructions, but needs to be one line. The ">" tells it to direct the output of nph-build.cgi into build_links.log.

2) It is advised to run buil_links.sh from the command line before entering the cron event into the table, just to make sure it works. You can do this by entering:

./build_links.sh

from the command line.

3) Make sure to add a line feed (return) at the end of mycron.txt! It will not work otherwise.

4) Optionally, you can add the following to the top of mycron.txt:

MAILTO=your@email.com

Supposedly, this will notify you via email if there are problems executing the cron job.

Hope this helps,
Dan
Quote Reply
Re: Addition to Cron Event directions In reply to
 
Code:
# Re-builds Index for LINKS
/path/to/cgi/links/admin/nph-build.cgi

Then you will be sent an email confirmation message with the completed job details.

Using the codes that Dan provided in the mycron.txt will send you an email and create a log file. But this is intensive in terms of disk space. You will double the disk space usage using this method.

I would recommend EITHER creating a log file OR getting an email confirmation message.

Regards,


------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Addition to Cron Event directions In reply to
Hi Eliot,

Quote:
Using the codes that Dan provided

Actually, Bobsie provided them, I just reiterated them. Wink

Quote:
This is only necessary if you want both a log file created and an email sent to verify that the job has been completed.

I'm not sure about this, but I think with my server at least, this format only sends email if there are problems while running the cron job. The log file is saved regardless and is deleted when the next cron event is run. For my database of ~2,500 links, the log file is only 40k or so, which is a minimal amount of disk space.

I don't see that there's much harm to doing both. Besides, it was the tech support from my host that recommended adding the email notification to stay on top of any problems, as "any number of things can go wrong with crontab while unattended."

Dan
Quote Reply
Re: Addition to Cron Event directions In reply to
  
Quote:
The log file is saved regardless and is deleted when the next cron event is run.

Nope....If you take out the > /path/to/links.log, the log file will NOT be built.

The email message sends a complete copy of the cron job from the Cron-Daemon.

In terms of disk space, the number of links in your database is not the only factor that affects the size of the log file. But also additional build routines and how you set up your Popular cutoff also affect the size of the log file that is built from the Crontab. In addition, the number of categories you have also affects the size of the log file.

For example, when I used to build the log file, it was about 135K. When I set the email option that you mentioned, I was being sent 135K of data plus the log file 135K. On a daily basis, I was filling my account with 270K of unneccessary data. Having the email ONLY sent with no log file is saving 135K of real estate in my account.

But you are free to disagree if you want.

Wink

Regards,

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------




[This message has been edited by Eliot (edited December 22, 1999).]
Quote Reply
Re: Addition to Cron Event directions In reply to
Sorry, I was unclear when I said that the log file is built regardless. What I meant to say is that with Bobsie's setup (which I used and posted here), whether or not you add the email line, the log file will be created.

Again, I think the email notification is dependent on how the server is set up. I don't receive an email because the job is run with no problems, thus no output. In this case, there's only the one log file at any given time and no emails in the inbox or trash. Seems preferable to me. Of course, it's just that -- a preference.

Dan
Quote Reply
Re: Addition to Cron Event directions In reply to
Again, the log file is only built if you add the following codes:

Code:
> /path/to/cgi-bin/links/links.log

If you don't have it there, it won't build a log file. This is true for the Cron-Daemon running on Apache. I don't know what OS or web server software you are using. But the Cron-Daemon acts similar across most UNIX servers.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Addition to Cron Event directions In reply to
We're talking about two totally different things here. I realize that the log file is optional. The email notification is what I said seems to be different on different servers.

Cheers,
Dan
Quote Reply
Re: Addition to Cron Event directions In reply to
The only time that email is sent out on my server (without specifying that mailto command in the shell file) is when there is a problem with the Cron job. This happens AUTOMATICALLY without setting the mailto command. Again, I do not think that the mailto command is necessary unless you want a copy sent via email and have a log file built.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Addition to Cron Event directions In reply to
Can we agree to disagree? Smile

I can say with absolute certainty that my server is set up differently than yours with regards to cron email notification, and I have no idea which is considered more standard.

What I posted above is what tech support told me to do, and it works just fine -- no email after a successful build.

Dan
Quote Reply
Re: Addition to Cron Event directions In reply to
 
Quote:
Can we agree to disagree?

Sounds good to me!

Quote:
What I posted above is what tech support told me to do, and it works just fine -- no email after a successful build.

Well...that is fine and dandy...But for Apache web servers running on BSD UNIX servers using the Cron-Daemon...the stuff I've posted is 100% absolutely TRUE.

Wink

Regards,


------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Addition to Cron Event directions In reply to
Hi Eliot,

Here's my server info (FutureQuest):

Apache/1.3.9 (Unix) mod_macro/1.1.1 PHP/3.0.12

Linux Kernel: 2.2.12pre12

You probably know better than I do what that means...

Dan


[This message has been edited by Dan Kaplan (edited December 27, 1999).]