• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

Edit root cron using Parallel Extension

nijina

New Pleskian
I was creating an Plesk extension and I need to edit root's crontab for the extension to work properly. While doing some experiment I understand that the Plesk extension works with the permission of psaadm . So I cannot use shell_exec to do this. Is there any api or cli interface where I will be able to do this. Is there any possibility to override the restriction of psaadm user through extension.
 
Hello,

I was finally able to find a solution. The extension works perfectly with Plesk 12.0 version. I am using pm_ApiCli::callSbin to do this. But in older versions I am getting undefined method error. The exact error is pasted below.


ERROR: Call to undefined method pm_ApiCli::callSbin() (IndexController.php:17)

In the release note of Plesk I can see below statement.

==============
New APIs for developing Plesk extensions are available
===============

But it hasn't mentioned the new API. It will be really helpful if someone from Plesk can provide a right solution.
 
Last edited:
AFAIK, callSbin is indeed a new API. However, I think there's an API for creating scheduled tasks in 11.5. It should probably help you.
 
Nikolay,

Thank you for your help. However I need to do many tasks with root privilege and editing cron job is only one of them.
 
Then target Plesk 12.0 only :)

I'm not entirely sure, but scheduled tasks seem to be the only way to execute something with superuser privileges from Plesk 11.5 extension.
 
Back
Top