cpanel-UAPI-php-class icon indicating copy to clipboard operation
cpanel-UAPI-php-class copied to clipboard

Create Cronjob

Open fmosse opened this issue 5 years ago • 2 comments

Hi,

The script is excellent! I can create a MySQL db and a username to it.

I also would like to create a cronjob. It is possible?

Thanks, Francisco

fmosse avatar May 16 '20 07:05 fmosse

@fmosse - thanks :) I have since built something similar but for use with any restful API (not just Cpanel) - See the apicore project.

As for Cron, i'm not sure. You should be able to use this class to do anything allowed in the UAPI or API V1 / V2 docs, but after a brief look i can't see any way to manage cron jobs with the existing cPanel API, so the likely answer is no.

You could always look into creating your own UAPI module for cPanel and exposing that to the API, but given that cPanel is largely written in Perl, that might be more effort than its worth.

N1ghteyes avatar May 17 '20 20:05 N1ghteyes

Thanks for your reply! Your code is excellent, I am using it for a personal script (to preinstall custom wordpress websites for clients).

I have also published this thread https://forums.cpanel.net/threads/cpanel-api-2-functions-cron-add_line.672385/ when I mention a link I found (https://documentation.cpanel.net/display/DD/cPanel+API+2+Functions+-+Cron%3A%3Aadd_line) but nobody answered me.

Thanks, Francisco

fmosse avatar May 18 '20 08:05 fmosse