Does cpanel service manager interfere with cron jobs?
I need to setup a cron job to stop and start mysqld. My concern is that when it goes down server manager will try to restart or issue warnings when my desire *is* for it to go down for a specific period of time everyday and not be restarted by server manager. . .
-
I believe the answer will be dependent on how log it's down. Are you just restarting MySQL or leaving it down for an extended period of time? 0 -
It would need to be down for no more than an 90 minutes in the a.m. like 2 -3-ish a.m. 0 -
Hey there! It sure will - we'll detect the service as down during our checks and try to restart it. Is this related to the server load issues from the other post? You could use the API to disable service monitoring during that time as part of a larger bash script using this tool: Enable or disable a service and its monitoring 0 -
yes it is related to the server load issues from the other post. yes I see that i can enable/disable in the whm gui interface for services. I don't want to globally turn off monitor/restart in the gui and I'm guessing I will need to use a script or activate a script in a cron job. Based on what you sent me to can you confirm that my option would be run this command in a cron job as such: 0 -
yeah I thought so, too. Thanks cPRex much appreciate the clarity. Speaking of clarity, why does this forum always ask for my tracking preferences when logging in? This seems like a new thing but since my computer automatically deletes cookies on a regular basis, why can't it remember my preferences by my email address as most other posting services do that so we don't always have to unclick our preferences to enter the forum. I know this is message is not for this particular forum so advise where should I request this. . . thanks again. 0 -
I'm not sure, but we're moving away from Xenforo soon so it's not something we're going to make the effort to track down. I also seem to have to choose my cookie options more than I would expect. 0 -
Thanks. SOLVED! 0 -
The session value changes each time you log in to cPanel, but it will be in the URL. 0 -
No, you wouldn't be able to use a cron job like that. For a cron, it would be best to use the Bash/command line API instead of the URL version, which uses the WHMAPI1 command line option: whmapi1 configureservice service='mysql' enabled=1
0 -
no joy with: 45 21 * * * whmapi1 configureservice service='mysql' enabled=0 0 -
I'm not an expert on this particular API call, but I'd think you would want monitored=0, not enabled. 0 -
SOLVED: You need to provide the full path to the whmapi1 this worked 23 22 * * * /usr/local/cpanel/bin/whmapi1 configureservice service='mysql' enabled=0 0 -
I've found that in crons it's usually best to provide the full path as they don't have BASH's built-in $PATH variable to know where to look for executables. 0
Please sign in to leave a comment.
Comments
16 comments