• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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