Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    4
    Rep Power
    0

    Red face CRON job won't run


    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. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,800
    Rep Power
    1103
    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.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    4
    Rep Power
    0

    Unhappy Nope!


    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.

    ????????
  6. #4
  7. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,800
    Rep Power
    1103
    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.
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    4
    Rep Power
    0
    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.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    4
    Rep Power
    0

    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
  12. #7
  13. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,782
    Rep Power
    4301
    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

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Location
    Germany
    Posts
    394
    Rep Power
    14
    This is just a guess, did you restart the cron daemon?

    kill -HUP

    -- Steven
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Location
    Germany
    Posts
    394
    Rep Power
    14
    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?
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    2
    Rep Power
    0

    Cool


    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
  20. #11
  21. No Profile Picture
    ......@.........
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2004
    Posts
    1,345
    Rep Power
    59
    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.
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jul 2004
    Location
    Middle Europa
    Posts
    1,198
    Rep Power
    17
    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
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    2
    Rep Power
    0

    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
  26. #14
  27. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    60
    Rep Power
    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
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jul 2004
    Location
    Middle Europa
    Posts
    1,198
    Rep Power
    17
    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'
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo