Changeset 9 for trunk/www/process_tasks.php
- Timestamp:
- Jun 11, 2009, 11:26:18 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/process_tasks.php
r8 r9 3 3 include('global.php'); 4 4 5 chdir('..'); 6 7 $Script = '/tmp/wowhosting_script.sh'; 8 $DbResult = $Database->query('SELECT * FROM Task WHERE Executed = 0 ORDER BY Id,Time ASC'); 9 while($Task = $DbResult->fetch_assoc()) 10 { 11 echo('Provádím '.$Task['Title']."...\n"); 12 $Task['CommandList'] = "#!/bin/sh\n".$Task['CommandList']; 13 file_put_contents($Script, $Task['CommandList']); 14 chmod($Script, 0755); 15 passthru($Script, $Output); 16 //exec($Script, $Output); 17 $Output = ''; //implode("\n", $Output); 18 //echo($Output); 19 $Database->query('UPDATE Task SET Executed=1, Output="'.addslashes($Output).'" WHERE Id='.$Task['Id']); 20 } 5 $Task = new Task(); 6 $Task->ProcessAll(); 21 7 22 8 ?>
Note:
See TracChangeset
for help on using the changeset viewer.