run bash script using cron job

Discussion in 'Site & Server Administration' started by ntesla123, Dec 21, 2011.

  1. #1
    How do I run a bash script every 15th minute by making a cron job on cpanel?

    I have tried to just enter the path of the script, and then to enter /bin/bash /path/to/script.sh, but that didn't work.
     
    ntesla123, Dec 21, 2011 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    Hello there,

    The best option would be to check with your host, as they would know the server setup, and should be able to help with your problems. I would also suggest you check your script to ensure it has execute permissions, and that the coding itself is correct.

    Chris
     
    RHS-Chris, Dec 21, 2011 IP
  3. netex

    netex Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    A most popular issue in crontab - it's a absolutic and relative pathes :)
    Check again.
     
    netex, Dec 24, 2011 IP
  4. expertvm

    expertvm Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Or you can post your script here and we will try to assist?
     
    expertvm, Feb 7, 2012 IP