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

eugene_b

Registered
Oct 3, 2012
1
0
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
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.