• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

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