Thread: creating cron job

  1. #1
    Registered User
    Join Date
    Dec 2006

    Smile creating cron job

    I have written one cron.txt in which i have put
               1,5,10,15 * * * * /root/
    then typed
    crontab cron.txt
    to lad the cron job.
    and also contains a command to run a C program executable.
    This is not working.Please guide me to write a cronjob which will run after every 5 mins to run the script

    Thank You,

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Check these files


    If you're not allowed, or denied, then you can't use cron.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Dec 2006
    Salem ,
    I have /etc/cron.d/cron.deny which is empty.this means I can execute crontab command.
    I followed following steps.
               1) I created shell script which runs a expect script for SCP.And it is running      successfully.
                2) then I created  cron.job which contains.
                              1,5,10 * * * *  /root/
                     this means I want to execute at 1,5,10 mins 
                3)  then loaded this job by executing 
                             crontab cron.job

  4. #4
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Hmmm, I was unaware that one could create a separate file that would load the cron job. I have always just done crontab -e (as root, which it looks you are too) then added the line to the root user file (that'd be something along the lines of */5 * * * * /root/

    When crontab is complete, it signals crond to reload the config file that was just edited.

    Also, your script will need to be executable, and no assuptions can be made about the path that you use. You'll either need to use fully qualified filenames or set the environmental variable PATH at the top of your script.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. crazy pipe/fork
    By fortune2k in forum C Programming
    Replies: 8
    Last Post: 03-13-2009, 11:28 AM
  2. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  3. Totally confused on assigment using linked lists
    By Uchihanokonoha in forum C++ Programming
    Replies: 8
    Last Post: 01-05-2008, 04:49 PM
  4. a VB.NET job
    By Brain Cell in forum A Brief History of
    Replies: 20
    Last Post: 05-09-2005, 06:41 PM
  5. I can't find a job.
    By Cheeze-It in forum A Brief History of
    Replies: 42
    Last Post: 06-29-2003, 08:35 PM