|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
I have the following cron:
30 23 * * * kunden/homepages/34/d87200027/htdocs/cgi-bin/mailReminders.pl The .pl has been tried at 755 and 777 The path has been tried as just /cgi-bin/mailReminders.pl as well The script works if manually run by the web browser, but I can't get the Cron to do it automatically Cron is supposed to be supported on the server The web host hasn't got a clue about what could be wrong as "they just provide the space not programming help" Is there something obvious I'm missing, or any ideas on what could be stopping it from working? Many thanks |
|
#2
|
||||
|
||||
|
It looks like you're trying to use the absolute path to the script, but you're not b/c you don't start the command with a forward slash (/). Try /kunden/homepages/... or whatever the complete, absolute path is, but lead with a forward slash.
__________________
# Jeremy Explain your problem instead of asking how to do what you decided was the solution. |
|
#3
|
|||
|
|||
|
This was such an obvious error I hoped it would be the cause - however, have added the '/' and still not working.
The absolute path is correct as my perl programmes are working fine. ???????? |
|
#4
|
||||
|
||||
|
Depending on what the script is doing, you may be having some permission problems. Cron usually runs under its own user, so if you're trying to modify a file, the script may be dying b/c it "cron" can't access your file. This would explain why it runs in the web browser, as it's probably getting put through some kind of wrapper to execute the script as you. Check for something like that in your code. If you can't find anything, post what you have and I'll look through it. I haven't used a lot of Perl in a while, but I should still be able to read what's going on.
|
|
#5
|
|||
|
|||
|
The mailreminders.pl does not write to anything - it just emails reminders depending on whether a diary entry to a database is due.
All the text for the emails is contained within the .pl script Do you know of something simple I can set up to see if it is the Cron that is not working, rather than the .pl script? Sorry to be a pain but this is the first time I have tried to use this system. |
|
#6
|
|||
|
|||
|
Any further help available?
Is there a way to test if a CRON command is running?
Have just been onto the hosts again and hitting a brick wall. The .pl script works fine from the browser command line - but nothing happening with the cron. I need to find out for definite if it is the .pl script causing the problem or the cron system isn't set up properly by the hosting company |
|
#7
|
||||
|
||||
|
Try typing this:
ps -xa | grep crond and report the output here.
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#8
|
|||
|
|||
|
This is just a guess, did you restart the cron daemon?
kill -HUP -- Steven |
|
#9
|
|||
|
|||
|
You might want to tell cron to use a specific user between the weekday-asterisk and the path.
You can also pipe the output somewhere so you can see any error code. Does this .pl script need to be called from a browser? |
|
#10
|
|||
|
|||
|
Hi.
I have the same problem. I try to execute a bash script with CRON and it does not run. If I execute it manually it works. Must I add (or overwrite) some variable to environment? Other cron tasks (scripts more simple) work. Thank you for answering César ![]() |
|
#11
|
|||
|
|||
|
Try forcing some kind of error log -
Code:
/kunden/homepages/34/d87200027/htdocs/cgi-bin/mailReminders.pl 2>/tmp/mailReminders.log Chances are good that PATH is not defined correctly for this script to run, or some other env variable is not set correctly. cron does not leave error logs by default. |
|
#12
|
|||
|
|||
|
sleepyfrog
please help yourself, there are tousend threads regarding your cron probl. always the same answer: cron has a very LIMITED environment! MIMIMAL PATH and knows only data from /etc/passwd |
|
#13
|
|||
|
|||
|
T
Thanks to all for answering me.
Already I solved it. Solution: put the whole env. n the script. In order that the possibility will bring of def. and overwrite the environment if it does not work? Regards. César |
|
#14
|
|||
|
|||
|
Hi César,
Rather than setting the environment in the script you can dot the .profile via: . ~/.profile This is for the korn shell. Other shells have different hidden files (files starting with a .) in your home directory. You can see these with: ls -a Cheers, Andy |
|
#15
|
|||
|
|||
|
hi andyb1ack
no intention to be rude...but Q1: why do you answer to a solved thread? Q2: why do you give imprecise answers ? the ~ in ~/.profile is 100% an invention of mr. korn (copied from csh) ![]() and the .profile is 100% an invention of mr. bourne (~197[3-8]) ![]() sure the statement: dot filename is 100% correct ![]() for sh, ksh, bash ... other csh can it better sleepyfrog: hast du schon mal 'man cmd-name' probiert... umwerfend ![]() was alles rauskommt bei: man cron sh ksh es ist sicher nicht meine aufgabe, will auch nicht beleidigend wirken ... 'wach auf' |