Jump to content

First Cron


Recommended Posts

I've just installed and indexed my site with iSearch and I would like to automatically index the site once weekly. The script suggests using a cron job and suggests the following command line syntax :

 

/usr/bin/php -q /home/user/public_html/isearch/admin/reindex.php

 

 

Is this correct and or allowed?

 

Thanks,

-Ty

Link to comment
Share on other sites

Hmmm, I set it to run crontab last night (using line from first post) and it seems not to have worked. I imagine I was to receive an email?

Settings were :

 

*  3  1  *  *

 

That's 3am every Monday, right?

 

That directory is protected, at the insistance of the script. Is that why the crontab didn't run?

 

Thanks

-ty

 

And on a side note - when I manually indexed the site it came up about 2000 records short. Maybe I just haven't configured it correctly. Blea.

 

Head Bash

Link to comment
Share on other sites

Boxturt, since I'm rather new to cron (old hosting company didn't allow) I can't say for sure... but here's how I would trouble shoot:

 

I'd put a simple php script in the same director that does nothing but send you an email. Then I'd set up a new cron directive set to execute the script every other minute. This should give you some indication if your idea is going to work (and I think it will).

 

Also, it looks like you are setting up a cron job with the 'advanced' option (writing it by hand). Have you considered setting it up by using the 'basic' cpanel interface?

Link to comment
Share on other sites

That is of course a very good suggestion. I'm a little embarassed to say I wouldn't know a simple php mail script if it jumped out and bit my nose. I'll see what I can figure out Thank you.

 

Ok, i was able to get something with a javascript. Got the following:

 

/bin/sh: /home/lyricsp/public_html/isearch/admin/crontest.html: Permission denied

 

Guess that means I can't run cron in a protected folder?

Edited by boxturt
Link to comment
Share on other sites

Doesn't have to be PHP... as you probably figured out.

 

But here's what I'd write

 

test.php

<?php

mail("you@******", "Test subject", "This is a test message for cron job test.", "From: Your Website");

?>

Link to comment
Share on other sites

Well, here's the 'letting you know' part. Something happened when the job ran but I think it stopped. Here's what cron-daemon mailed me:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<HEAD>

<TITLE>iSearch Reindex Site</TITLE>

<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8">

<META HTTP-EQUIV="Content-Language" CONTENT="EN-GB">

<META HTTP-EQUIV="Pragma" content="no-cache">

<META HTTP-EQUIV="Expires" content="Fri, 01 Jan 1999 00:00:01 GMT">

<META NAME="author" CONTENT="Ian Willis">

<META NAME="copyright" CONTENT="Copyright Ian Willis. All rights reserved.">

<META NAME="robots" CONTENT="noindex,nofollow">

</HEAD>

 

<BODY BGCOLOR="#ffffc0" TEXT="#000000">

 

<H1>iSearch Reindex Site</H1>

<H3>Spidering Starting Now...</H3>Processing URL [http://lyricsplayground.com/]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestecritsurlesmurs.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestenfrance.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/top_frame.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestenseptembre.html]<BR>

Processing URL [http://lyricsplayground.com/home.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestextra.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestfatal.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestfini.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestfinimissmolly.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestlaouate.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestlavie.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestlaviequiveutca.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestlamour.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestlamouretlaviequejetedois.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestlemashedpotatoes.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestleprintemps.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestlerefraindemavie.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestlereggae.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestlointoutca.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestluiquemoncoeurachoisi.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestluiquidort.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestmachanson.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestmavie.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestmerveilleux.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestmerveilleuxlamour.html]<BR>

URL not changed since last spidering [http://lyricsplayground.com/alpha/songs/c/cestmieuxainsi.html]<BR>

Processing URL [http://lyricsplayground.com/guestbook/]<BR>

</BODY>

<HEAD>    <META HTTP-EQUIV="REFRESH" CONTENT="1;URL=?reset=false"></HEAD></HTML>

 

Checking the number of files indexed I see it hasn't changed and if it had run all the way the number reflected would certainly be different. (that "refresh" tag bugs me a bit and I don't know where it came from.)

 

Any thoughts? This is driving me nuts

 

Head Bash

Link to comment
Share on other sites

I wish I had direct experience with this script... but I don't. You might want to consider PM to those in this thread that seem to have used it successfully.

 

On another note, it appears that the cron is working... so maybe your issue is with the script.

 

To troubleshoot, I would change one of these files and see what happens the next go-round.

Link to comment
Share on other sites

I guess all I can do is keep tinkering. I really don't know why it stopped after that handful of files. I have indexed manually and it was more or less correctso it shouldn't have anything to do with number of files either (+16,500).

 

If I get an invitation to PM someone I will * wink*wink*nudge*nudge*

 

Thanks

Link to comment
Share on other sites

I really don't know why it stopped after that handful of files.

Some TCH servers run an automatic script every 5 minutes that kills jobs

that take more than a certain amount of CPU time.

 

You can ask the sysadmin team to have the indexing script be exempted

from the automated kill function. (This has been done on server20.)

 

If you're lucky with your timing, you can start your indexing script

just after the last process kill script ran, and this gives you five

uninterrupted minutes to get your site indexed before the next time

processkill runs. Maybe you can get it done in that time...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...