I have a problem when executing a shell command. The problem is that I would like to run a command exec('du -sh /var/www/backups/* > backups.log') but I would like to just press "START" and read backups.log later. Right now when I press the button I have to wait until it finishes, so the page waits until the script finishes.
Add a comment
|
2 Answers
You can use AJAX for resolve this problem, no ? When the user click on start, execute your Php script. During that, you can do everything else.
1 Comment
Robert K
It wouldn't be reliable. The ajax request will wait for the script to complete, which may take minutes, and the php script would likely terminate once the connection dropped (if the user left the page).