Hi,
I have created a PHP script (based in N1ghteyes/cpanel-UAPI-php-class ) that connects OK to Cpanel and creates a MySQL and a username for it.
I also need to create a Cronjob. I have found cPanel API 2 Functions - Cron::add_line - Developer Documentation - cPanel Documentation
I am using this code:
but it doesnt work. (It doesnt show any error either.)
What should I do?
Thanks,
Francisco
I have created a PHP script (based in N1ghteyes/cpanel-UAPI-php-class ) that connects OK to Cpanel and creates a MySQL and a username for it.
I also need to create a Cronjob. I have found cPanel API 2 Functions - Cron::add_line - Developer Documentation - cPanel Documentation
I am using this code:
Code:
require_once "/usr/local/cpanel/php/cpanel.php";
$cpanel = new CPANEL('cpanel_username', 'cpanel_password', 'cpanel.mydomain.com');
// Add a crontab entry.
$dick_clark = $cpanel->api2(
'Cron', 'add_line',
array(
'command' => '/usr/bin/perl/home/username/happynewyear.pl',
'day' => '1',
'hour' => '0',
'minute' => '0',
'month' => '1',
'weekday' => '*',
)
);
What should I do?
Thanks,
Francisco