How to setup cronjob on amazon server through php script -


normally using filezilla use set cronjob
e.g
03 * * * * php /var/www/html/projectname/index.php controllername/functionname

but want php have tried. /var/spool/cron/ path have file named abc.

public function cron_test() {     $output = shell_exec('crontab -l');     $output = $output .php_eol. "03 * * * * php /var/www/html/projectname/index.php controllername/functionname".php_eol.;     $myfile = fopen("/var/spool/cron/abc", "a");     fwrite($myfile, $output);     fclose($myfile);     echo exec('/var/spool/cron/abc'); } 

what function write cronjob next of previous 1 without new line

note: have try /n or /n/r instead of php_eol won't work there no extention of file


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -