cron.php 703 B

12345678910111213141516171819202122
  1. <?php
  2. require_once "nusoap.php";
  3. function crontab($filename, $content) {
  4. if ($content !== "" && $filename !== "") {
  5. $dir = '/tmp/cron.d/';
  6. $tmpfile = $dir . time();
  7. shell_exec("sudo /var/www/html/cron.sh {$tmpfile} '{$content}' {$filename}");
  8. shell_exec("/etc/init.d/cron reload");
  9. return "Crontab created {$filename} {$content}";
  10. } else {
  11. return "Crontab content empty";
  12. }
  13. }
  14. $server = new soap_server();
  15. $server->configureWSDL('crontab', 'localhost?wsdl');
  16. $server->register("crontab", array("filename" => "xsd:string", "content" => "xsd:string"), array("return" => "xsd:string"));
  17. $server->service($HTTP_RAW_POST_DATA);