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!

A way to automatically set up cron jobs when account is created?

Discussion in 'General Discussion' started by eugene_b, Oct 3, 2012.

  1. eugene_b

    eugene_b Registered

    Joined:
    Oct 3, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    We have a cPanel server where we host websites of our clients. All the websites are powered by our software which requires several cron jobs to function properly. Is there a way to automatically set up these crons whenever a new account is added? So let's say we add some-site.com. This automatically means that we as well want to set up a cron that does something like
    wget http://some-site.com/index.php?run_scheduler=1 >/dev/null &
    wget http://some-site.com/index.php?run_importer=1&run_scheduler=1 >/dev/null &

    Thanks,
    Eugene B
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,323
    Likes Received:
    1,851
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    You could create and utilize the following file to complete an action automatically after an account is created:

    Code:
    # /scripts/postwwwacct
    It would involve developing a custom script that automatically creates a specific cron job, and then using the above file to ensure that script runs after account creation. You can find the API documentation for adding cron jobs at:

    API - Cron Jobs

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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