Re: [請益] shell_exec的疑問
※ 引述《s66449 (閒泡菜)》之銘言:
: 我想要讓php裡
: 可以直接設定linux的cron
: $shell=shell_exec('crontab -e');
: 請問直接這樣寫是不行的嗎??
<?php
$tmp_cron_file = '/tmp/crontab.tmp';
$cron = shell_exec('/usr/bin/crontab -l');
$cron .= $new_cron_str;
file_put_contents($tmp_cron_file, $cron);
shell_exec("/usr/bin/crontab $tmp_cron_file");
unlink($tmp_cron_file);
?>
--
我不寂寞, 因為煙在我口,
我不寂寞, 因為酒在我手,
我不寂寞, 因為還有寂寞陪著我.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.37.132.213
※ 編輯: JoeHorn 來自: 114.37.132.213 (03/13 17:39)
推
03/13 20:28, , 1F
03/13 20:28, 1F
→
03/13 20:29, , 2F
03/13 20:29, 2F
→
03/13 20:30, , 3F
03/13 20:30, 3F
→
03/13 20:31, , 4F
03/13 20:31, 4F
→
03/13 20:32, , 5F
03/13 20:32, 5F
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章