Reputation: 3416
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.
Upvotes: 4
Views: 2047
Reputation:
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.
Upvotes: 0
Reputation: 71384
Trying launching the process in the background by adding "&" like this:
exec('du -sh /var/www/backups/* > backups.log &');
Upvotes: 5