Results 1 to 6 of 6

Thread: Crontab not executing job

  1. #1
    Join Date
    Sep 2011
    Beans
    14

    Crontab not executing job

    Hi all,

    I am using CentOS release 6.2 (Final).
    have file /var/spool/cron/root .
    crontab -l shows :
    PATH=$PATH:/etc
    01 * * * * date >> /testCron.tsv

    but not getting /testCron.tsv...

    Regards,
    Rohit.

  2. #2
    Join Date
    Jan 2010
    Location
    CT USA
    Beans
    397
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Crontab not executing job

    Try including the full path to the date command

  3. #3
    Join Date
    Sep 2011
    Beans
    14

    Re: Crontab not executing job

    hi cjhabs,

    tried ur suggestion.. didn't worked..

    Regards,
    Rohit

  4. #4
    Join Date
    Jan 2010
    Location
    CT USA
    Beans
    397
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Crontab not executing job

    crontab -l should just show cron entries - the first line, PATH=$PATH:/etc, is not a cron entry so I suspect that the scheduler is quitting on you. If you remove that first line that should fix the issue

  5. #5
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,660
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Crontab not executing job

    Hi rohit verma.

    You are trying to write to the root directory. That would only work if the user who is executing the script has permissions to do that.

    If you are creating the crontab with your regular user, that won't work.

    Either change the destination to a directory you have permission to write, or create the crontab as root (I would avoid the last option at much as possible).

    Let us know how it goes.
    Regards.

  6. #6
    Join Date
    Sep 2011
    Beans
    14

    Re: Crontab not executing job

    thanks buddies,
    for your responses..

    now crontab -l shows :
    * * * * * /bin/date >> /tmp/testCron.tsv

    and wooho! its working....

    Regards,
    Rohit.
    Last edited by rohit verma; October 17th, 2012 at 07:08 AM.

Bookmarks

Posting Permissions

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