Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Cron Job in shell

Discussion in 'General Discussion' started by netlook, Apr 19, 2004.

  1. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    166
    Hello, please write me how can I add any cron jobs to make them working on my server automatically.

    I know, that it should be cron job, but I realy don't know where (in which file) I have to make the request. For eg. I want to clean my TMP from sess* files.

    Regards
     
  2. HostEntrance

    HostEntrance Active Member

    Joined:
    Apr 19, 2004
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    151
    Location:
    Oh Canada
    go to /etc/cron.daily and add the cron job you wish to run in there ;)
     
  3. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    166
    But cron.daily is a directory, and there are something like executable scripts, so have I write something in #/bin/bash :) or maybe should I pico there simple 40 4 * * * /something file? Excuse for my newbie questions, but I realy don't know...
     
  4. HostEntrance

    HostEntrance Active Member

    Joined:
    Apr 19, 2004
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    151
    Location:
    Oh Canada
    simply place your script in that directory and it will run everyday. no need to add * * * * 1 in your script
     
  5. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    166
    Ok, so I will make somethign like this:

    --
    rm -f /tmp/sess_*
    --

    as 1 file and I hope this would work for me :)
    Big THX.
     
  6. HostEntrance

    HostEntrance Active Member

    Joined:
    Apr 19, 2004
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    151
    Location:
    Oh Canada
  7. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    Make sure the chmod is set correctly so it can execute or it will not work.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    166
    Yes, I noticed that when I try to check this :) Now everything seems to be ok :) THX
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice