Results 1 to 11 of 11

Thread: to run crontab

  1. #1
    Join Date
    Oct 2003
    Posts
    232

    Talking Unanswered: to run crontab

    here are 2 script file that i need to run through crontab every day at 1 am
    file name verscript, ver1script

    What should be contained in my crontab file this

    0 1 * * * /usr/viis/conf/./verscript
    0 1 * * * /usr/viis/conf/./ver1script


    or

    0 1 * * * ./ usr/viis/conf/verscript
    0 1 * * * ./ usr/viis/conf/ver1script
    bigfoots

  2. #2
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    doing 'man crontab' yields:

    crontab Entry Format
    A crontab file consists of lines of six fields each. The
    fields are separated by spaces or tabs. The first five are
    integer patterns that specify the following:


    minute (0-59),
    hour (0-23),
    day of the month (1-31),
    month of the year (1-12),
    day of the week (0-6 with 0=Sunday).

    Each of these patterns may be either an asterisk (meaning
    all legal values) or a list of elements separated by commas.
    An element is either a number or two numbers separated by a
    minus sign (meaning an inclusive range). Note that the
    specification of days may be made by two fields (day of the
    month and day of the week). Both are adhered to if specified
    as a list of elements. See EXAMPLES.
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

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

    Cool

    This:
    Code:
    0 1 * * * /usr/viis/conf/verscript
    0 1 * * * /usr/viis/conf/ver1script
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  4. #4
    Join Date
    Oct 2003
    Posts
    232

    Arrow

    I have tried the above code does not work


    i did crontab -e type in the code, do i need to do anything after that
    bigfoots

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

    Cool

    Quote Originally Posted by sjumma
    I have tried the above code does not work
    i did crontab -e type in the code, do i need to do anything after that
    1) Are your scripts executable (chmod +x ver*)?
    2) Are you setting the environment variables (like with .profile)?
    3) Try executing like this:
    Code:
    0 1 * * * /usr/viis/conf/verscript >/tmp/verscript.log
    0 1 * * * /usr/viis/conf/ver1script >/tmp/ver1script.log
    ...and check out what the /tmp/ver*.logs say.

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  6. #6
    Join Date
    Oct 2003
    Posts
    232

    Arrow

    i have given chmod 777 to both verscript and ver1script

    both are ksh script which outputs a ver1copy.bat and vercopy.bat

    they are in /usr/viis/conf


    but still does not run
    bigfoots

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

    Question

    Quote Originally Posted by sjumma
    i have given chmod 777 to both verscript and ver1script
    both are ksh script which outputs a ver1copy.bat and vercopy.bat
    they are in /usr/viis/conf
    but still does not run
    Did you try the #3 format i suggested?
    What is in the /tmp/vercopy.log files?
    Do your scripts begin with: #!/bin/ksh ?
    What is this '.bat', are you using windows OS?

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  8. #8
    Join Date
    Oct 2003
    Posts
    232

    Arrow

    Did you try the #3 format i suggested?
    I tried your 3 format did not work

    What is in the /tmp/vercopy.log files?
    I did not see the log file i had forwarded to ie > /usr/viis/conf/test


    What is this '.bat', are you using windows OS?
    .bat file is the out put of my verscript which i will later from a window machine get it via an ftp


    Do your scripts begin with: #!/bin/ksh ?
    Yes it does so i tried using
    0 1 * * * /bin/ksh /usr/viis/conf/verscript

    /bin/ksh for directory where my korn shell is supposed to be


    at this moment i thing crontab is not set up fine
    bigfoots

  9. #9
    Join Date
    Oct 2003
    Posts
    232

    Arrow

    Did you try the #3 format i suggested?
    I tried your 3 format did not work

    What is in the /tmp/vercopy.log files?
    I did not see the log file i had forwarded to ie > /usr/viis/conf/test


    What is this '.bat', are you using windows OS?
    .bat file is the out put of my verscript which i will later from a window machine get it via an ftp


    Do your scripts begin with: #!/bin/ksh ?
    Yes it does so i tried using
    0 1 * * * /bin/ksh /usr/viis/conf/verscript

    /bin/ksh for directory where my korn shell is supposed to be


    at this moment i thing crontab is not set up fine

    any help will be appreciated
    i tried with
    * * * * * echo `date`

    did not work either
    bigfoots

  10. #10
    Join Date
    Dec 2003
    Posts
    56
    Quote Originally Posted by sjumma
    Did you try the #3 format i suggested?
    i tried with
    * * * * * echo `date`
    did not work either
    That command isn't going to work cause it has nowhere to output the DATE to. Change it so
    * * * * * date > /tmp/date.tmp

    Then every minute the /tmp/date.tmp should be refreshed with the current date and time.

  11. #11
    Join Date
    Oct 2003
    Posts
    232
    Got it yes the output has to be a file
    i taught it was taking default


    Thanks guys aprreciated
    bigfoots

Posting Permissions

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