Find the answer to your Linux question:
Results 1 to 5 of 5
Hey guys, i need help in cron, i gt this script on hand, but hw am i going to execute it with cron? my cron source is here... #!bin/bash 00 ...
  1. #1
    Just Joined!
    Join Date
    Jul 2007
    Posts
    59

    Cron !!! Help

    Hey guys, i need help in cron, i gt this script on hand, but hw am i going to execute it with cron? my cron source is here...




    #!bin/bash

    00 06 * * * / $home/user/myscript.sh >/dev/null 2>&1

    23 0-23/4 * * * /




    but hw do i execute it?

  2. #2
    Just Joined!
    Join Date
    Jul 2007
    Posts
    59
    and why do i keep getting permission deny?

  3. #3
    Linux Guru
    Join Date
    Nov 2004
    Posts
    6,110
    A couple of things are wrong there - you don't need the shabang in cron and also for reference your one is incorrect. It is #!/bin/bash. For this line you probably don't need the first / as $home defines your home directory. Bear in mind however that this will most likely not work under cron so replace it with the full path..

    Code:
    00 06 * * * / $home/user/myscript.sh >/dev/null 2>&1
    00 06 * * * /home/user/myscript.sh >/dev/null 2>&1
    That was a little collision between the variable and the path. Make sure also the script has execute permissions.
    Code:
    chmod +x /home/user/myscript.sh

  4. #4
    Just Joined!
    Join Date
    Jul 2007
    Posts
    59
    But hw come i still get errors like...


    "/home/user/cron":3: premature EOF
    errors in crontab file, can't install.

  5. #5
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    jeffrey_seeNJ,

    post exactly what your trying to put into cron here
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

Posting Permissions

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