cancel
Showing results for 
Search instead for 
Did you mean: 

Cron-ic mistake?

tony2007
Grafter
Posts: 115
Registered: 15-08-2007

Cron-ic mistake?

Hi,
I'm trying to set up a Cron-job on the new cgi server, but without much success
Cry
I'm using Putty software to set up a job which (re)builds my news pages every morning at 2.00am by accessing an autobuild script. This is what I've written in the cron file:

MAILTO=site@sociologyonline.force9.co.uk
0 2 * * * /files/home1/username/cgi-bin/News1/autobuild.cgi

But a) I get no mail informing of the job nor b) is the news page rebuilt.

Any advice would be greatly appreciated
thanks in advance

Tony
20 REPLIES
Marteknet
Grafter
Posts: 577
Registered: 13-10-2007

Cron-ic mistake?

try this

05 00 * * * /usr/local/bin/php $HOME/cgi-bin/News1/autobuild.cgi

Try uploading this crontab list in bin mode then telnet and crontab it to set it running.

Hope this helps.

Peter
tony2007
Grafter
Posts: 115
Registered: 15-08-2007

Cron-ic mistake?

Thanks Peter for the suggestion, but alas no success
Cry
I was curious as to the 'php' part of the path you suggested because I don't use php, so on a second attempt I took that bit out but still no success.
The really odd thing is that the path I suggested above, with obvious modifications to the absolute paths, works on the old server!!
Is this another case I wonder of things not being quite set-up right on the new server?
:x
Marteknet
Grafter
Posts: 577
Registered: 13-10-2007

Cron-ic mistake?

ooppps sorry i missed that, fingers typing faster than the brain was working.

try changing the /usr/local/bin/php part (it points to php) to point to perl.

Also it should be uploaded in ASCII mode not BIN mode see http://portal.f9.net.uk/central/forums/viewtopic.php?p=11968#11968
:roll:

I have just moved my crontab file from the old cgi server to the new one, used telnet to crontab the file then did a crontab -l and all the scripts were set to run at the set times. they all appear to work fine.

heres what i used in the crontab file (file names changed Smiley )

05 00 * * * /usr/local/bin/php $HOME/file1000.php
10 00 * * * /usr/local/bin/php $HOME/file1001.php
15 00 * * * /usr/local/bin/php $HOME/file1002.php
20 00 * * * /usr/local/bin/php $HOME/file1003.php
25 00 * * * /usr/local/bin/php $HOME/file1004.php
*/10 * * * * /usr/local/bin/php $HOME/file1005.php
*/10 * * * * /usr/local/bin/php $HOME/file1006.php

I don't use the email option as it was sending emails even when there were no errors on the old server. Force9 was told about the errorless emails and they said "yes you are right it is doing that" but never fixed it so i just left the email thing out after testing was finished.
tony2007
Grafter
Posts: 115
Registered: 15-08-2007

Cron-ic mistake?

Hi
Thanks for this - but I cannot get anything to work at the present time.
I changed the absolute path to include perl but no joy.
I kept the mailto cos even to have got an error message would have been something at least!
It's really annoying cos I've been following this tutorial on cron as well

http://portal.f9.net.uk/central/forums/viewtopic.php?t=2577

Which is really annoying cos the script - the very same script! - works great on crofters but not on the new server

By the way couldn't help but notice that the topic you refer to occured on this day last year - Spooky or wot?
Wink
Marteknet
Grafter
Posts: 577
Registered: 13-10-2007

Cron-ic mistake?

Quote

By the way couldn't help but notice that the topic you refer to occured on this day last year - Spooky or wot?
Wink


mmmmm Part of Force9's master plan to send us all crazy I expect :lol:
Marteknet
Grafter
Posts: 577
Registered: 13-10-2007

Cron-ic mistake?

Just one last idea for a test, can crontab call the script, are the paths correct ?, can you put a script in the root directory to call the script to test the path and access rights, if this idea works then I would imagine crontab is at fault, but if the calling script cant run the final script then there is a problem with the path or the access permissions.

sorry I couldn't be of more help to you.

Peter
N/A

Cron-ic mistake?

Can you also try putting a blank line at the end of it so the crontab reads:

MAILTO=email address

<command>
[BLANK LINE]
as there are reports of a bug in debian's version of cron.[/code]
tony2007
Grafter
Posts: 115
Registered: 15-08-2007

Cron-ic mistake?

Thanks Colin, but I tried the blank line already.
I know Peter says his scripts are working (only for php?) - but is cron actually available on the new server - only the self-same scripts (with modifications to paths obviously) are working on the old server!
I know you're not responsible for the server, but could you ask that engineer you're always referring to?
Wink
N/A

Cron-ic mistake?

Not personally, I can only poitn support at the thread really - I know my cron is sporadic over on the PlusNet server too... unfortunately.
Marteknet
Grafter
Posts: 577
Registered: 13-10-2007

Cron-ic mistake?

Sociologyonline are you still having problems getting crontab to work with .cgi scripts ? is the path to the file still /cgi-bin/News1/autobuild.cgi ?

I will write a dummy .cgi script and mount it in the same path on in my cgi-bin and see if I can find a way to get this going for you. (but don't hold your breath as you seem to have tried most things to resolve the issue.)

If you manage to get it working please let me know at pcm@martek-net.co.uk

Peter.
Marteknet
Grafter
Posts: 577
Registered: 13-10-2007

Cron-ic mistake?

As far as I can tell the crontab on the new ccgi server is not working. I have tried to replace the scripts that crontab on the old (current server) calls with scripts that access the new scripts on the new server. This doesn't work, because of security issues, I expect.

The only way I have found to mimic the new server crontab is the make copies of the new scripts and place them on the old server. While these scripts work fine for timed SQL database housekeeping routines, this sort of fix isn't any good if data stored on the new ccgi server need to be updated. I have not checked if its possible for these stopgap scripts to access the new server to pull data for reading only this may work, but fully expect that they will not be able to be written to.

I expect we will just have to wait for the change over to be complete before crontab and scripts on the new server run as intended.

Peter
N/A

cron runaround

I've been having intermittent cron problems on the new cgi server. First, I got denial from Support, then an acknowledgement that there's a problem.
They assure me this was fixed (the problem was described as "part of the server was missing" - kind of fills you with confidence) on the 18th July but I can't get even a basic cron script to work. I've replaced our actual cron script with this:

tectonics@cshell02:~/bin$ crontab -l
#tectonics ltd. - TEST cron jobs
#
# minute (0-59), hour (0-23), day of month (1-31), month of year (1-12), day of week (0-6, 0=Sunday)
#
* * * * * date > /files/home3/tectonics/testing_cron1
* * * * * date > ~/testing_cron2
0,5,10,15,20,25,30,35,40,45,50,55 * * * * date > $HOME/testing_cron3

All 3 "testing_cron" files have appeared on occassion - the last time on 15th July @ 10:42 but not since. I have done crontab -r, then re-loaded and all to no avail (sometimes I get crontab: permission denied).
Support just say "no-one else has reported a problem so it must be your script" - is there any problem with the script that I'm missing (I've tested on our servers an all's well)? Does everyone else have a functioning cron? If so, can they post a really simple script to prove if it's me or them!

Alex Shannon
N/A

Cron problems

I think Cron is broken on the new server. I had a crontab working fine on the new server but it stopped running on or about the 13th of July. I've emailed support but they just say "use the forums".

Not only is the cron job not running but if I try to run crontab I get a permissions error.

Is there anyone from Force9 monitoring this forum?
N/A

Re: Cron problems

Quote
Is there anyone from Force9 monitoring this forum?


Very doubtful, or if they are, they are VERY quiet.