Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2009
    Posts
    1

    Unanswered: Script in cronjob fails

    Hi ,

    I have a cronjob which is running perfectly fine from the past one year.

    Two days back one of the scripts present in cronjob failed to start, which forced me to run it manually.

    Now that script is not running at al, i have to run it manually.

    The crontab entries are below.

    Can anyone please help?

    The script marked in bold and italic failed to run.


    15 0 * * * /export/home/ceridwen/bin/run_cdr2daily.sh




    #!/bin/sh
    2
    3 PATH=/cw/bin:/cw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/local/bin:/opt/local/bin
    4 export PATH
    5
    6 ###############################
    7 #Changing SME name
    8 #/export/home/ceridwen/bin/fix2hicdrs.pl | mailx -s "output of fix2hicdrs.pl" example@example.com
    9 #/export/home/ceridwen/bin/sumAccounting5m.pl | mailx -s "output of Sum Accounting 5m.pl" example@example.com
    10
    11 ###### New #################
    12 /export/home/ceridwen/bin/fix2hicdrs.pl | mailx -s "output of fix2hicdrs.pl"
    13 /export/home/ceridwen/bin/sumAccounting5m.pl | mailx -s "output of Sum Accounting 5m.pl"
    14 ###############################
    15
    16 /export/home/ceridwen/bin/yesterdays_cdr2daily.pl -M SNMP
    17 /export/home/ceridwen/bin/yesterdays_cdr2daily.pl -M BULK
    18 /export/home/ceridwen/bin/yesterdays_cdr2daily.pl -M JBULK
    19 /export/home/ceridwen/bin/yesterdays_cdr2daily.pl -M SUM5M

    20 ## /export/home/ceridwen/bin/yesterdays_cdr2daily.pl -M JIPACC
    21 /export/home/ceridwen/bin/yesterdays_cdr2daily.pl -M IPACC
    22
    23 echo "update flags set flagvalue=1 where flagname='ready_for_mail_daily';" | mysql -ucdr cdr
    24 echo "update flags set flagvalue=1 where flagname='ready_for_gbag';" | mysql -ucdr cdr
    25 echo "update flags set flagvalue=`date +%s` where flagname='ready_for_mail_monthly';" | mysql -ucdr cdr
    26 echo "update flags set flagvalue=`date +%s` where flagname='ready_for_mail_billing';" | mysql -ucdr cdr
    27 echo "update flags set flagvalue=`date +%s` where flagname='ready_for_push_monthly';" | mysql -ucdr cdr
    28 echo "update flags set flagvalue=`date +%s` where flagname='ready_for_push_billing';" | mysql -ucdr cdr
    29
    30 /export/home/ceridwen/bin/cdraggregate.pl
    31
    Last edited by gvee; 03-31-09 at 09:50. Reason: email addresses replaced with example@example.com

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool set -x

    Without you providing error messages or anything else, it is dificult to "guess" what the issue is.

    Maybe something must have changed?.

    Add set -x and a log file to your script and cron:

    Code:
    ## In crontab:
    15 0 * * * /export/home/ceridwen/bin/run_cdr2daily.sh >/tmp/run_cdr2daily.log 2>&1
    ##
    ## In your script:
    #!/bin/sh
    PATH=/cw/bin:/cw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/local/bin:/opt/local/bin
    export PATH
    set -x
    ## Etc ...
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    It might also be worth editing your code to remove the email addresses. This will stop these user from getting spammed.

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    That's nothing compared to the guy posting user IDs and passwords to Credit Suisse servers the other day. I suspect outsourcing may not be as cost effective as it appears on the surface...
    ---
    "It does not work" is not a valid problem statement.

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Email addresses removed
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •