#1 (permalink)  
Old 11-09-2009, 03:16 AM
Registered User
 
Join Date: Nov 2001
Posts: 435
electric is on a distinguished road
Possible to run auto-add cron task with WHM plugin?

Hello,

I am thinking about developing a WHM plugin, but it would need to run once every day.

Is there a way to automatically add a task to cron when "installing" a plugin?

The problem is that the target market of this plugin is newbie resellers and server owners.. and they might not be able to figure out how to add something to cron.

(ie: It's hard enough to explain how to "install" a WHM plugin.. and asking them to fiddle with cron is very difficult. Thus, I'd prefer if there is some way to automate this step?)

I hope that makes sense.
__________________
I am an eNom ETP.
Sign up today if you want an eNom.com domain reseller account from a reliable provider.
* We now provide support and service to over 3250 happy resellers!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-10-2009, 04:31 PM
cPanelDon's Avatar
cPanel Staff (Administrator)
 
Join Date: Nov 2008
Location: Houston, Texas, U.S.A.
Posts: 1,511
cPanelDon is on a distinguished road
Lightbulb

Quote:
Originally Posted by electric View Post
I am thinking about developing a WHM plugin, but it would need to run once every day.

Is there a way to automatically add a task to cron when "installing" a plugin?
This type of action, to add a cron job or modify a crontab, may be performed by the custom script used to install the custom plug-in. To have a cron entry run just once a day, the entry could be added as a file in the following directory:
Code:
/etc/cron.daily/
__________________
For hands-on assistance please reference our new support information page: Where should I go for support?
cPResources: Support Options - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation
-- cPanelDon - Donald Holl, Technical Analyst, cPanel Technical Support
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-11-2009, 09:38 AM
Staff
 
Join Date: Apr 2005
Location: Houston, TX
Posts: 212
cPanelMatt is on a distinguished road
Well, as plugins have no real unified installation method at this time there isn't a way to do this. However you could always do a touch file to check if it's run for the first time or not.


f.ex (pseudo code):

if ( !-e /var/cpanel/$yourplugin/.notfirsttime ) {
install cron
do some setup stuff
touch /var/cpanel/$yourplugin/.notfirsttime
}
__________________
Matt Dees
cPanel, Inc.
cPanel Integration Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run plugin kamlesh_chaube cPanel Newbies 1 06-01-2009 06:53 AM
Plugin run as root abrender Developer Discussions 1 07-24-2008 09:34 AM
How to make an appointment a task in cron every 3 days? romzinho cPanel and WHM Discussions 2 11-15-2007 05:42 PM
how to add a cron in whm docesam cPanel Newbies 1 01-05-2007 12:45 PM
Cannot Schedule Cron Awstats Update Task stewartn cPanel and WHM Discussions 1 05-13-2004 10:19 PM


All times are GMT -5. The time now is 09:56 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc