Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I'm just not being able to run a simple cron job. Here is my crontab file: Code: #!/bin/bash PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/ewwstats/bin:/usr/java/bin:/home/ewwstats/bin * * * * * /bin/echo "Meh" >> /home/warlord/crontest.dat * ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2012
    Posts
    3

    Not being able to run cron


    Hi,

    I'm just not being able to run a simple cron job. Here is my crontab file:

    Code:
    #!/bin/bash
    PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/ewwstats/bin:/usr/java/bin:/home/ewwstats/bin
    
    * * * * * /bin/echo "Meh" >> /home/warlord/crontest.dat
    * * * * * env > /tmp/env.output
    As you can see, I have added the path variable as suggested elsewhere. There is a newline at the end. The command
    Code:
    pgrep cron
    does return me a number, which indicates that the service is running. I'm not an admin, so I can't restart the service.

    I just don't see those two output files "crontest.dat" and "env.outupt" being generated. Running just the command following the five starts does generate them, so there is nothing wrong with the commands themselves.

    Isn't five starts supposed to run the job every minute? What am I missing here?

  2. #2
    Just Joined!
    Join Date
    May 2011
    Location
    Central FL
    Posts
    91
    Everything looks OK.

    1. What distribution/uname are you on?
    2. Does your user have access/permissions to use cron?
    3. Are in you /etc/cron.{allow,deny}
    Last edited by dayid; 04-12-2012 at 07:02 PM. Reason: clarify questions

  3. #3
    Just Joined!
    Join Date
    Apr 2012
    Posts
    3
    Quote Originally Posted by dayid View Post
    Everything looks OK.

    1. What distribution/uname are you on?
    2. Does your user have access/permissions to use cron?
    3. Are in you /etc/cron.{allow,deny}

    * Distribution is CentOS release 5.6 (Final), uname is Linux.
    * How do I check if I have access/permissions to use cron? In the meanwhile, I'll also try asking the admins.
    * There is no /etc/cron.allow file and the file cron.deny is empty.

  4. #4
    Just Joined!
    Join Date
    Apr 2012
    Posts
    3
    Never mind. I just found out that cron jobs are not allowed on that system.

    Thanks for the reply. I could have never found it out on my own.

Posting Permissions

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