I am running a large PHP script with drush. The script takes a very long time to run - maybe a few hours, and I would like to stop it when I want. Here is an example php script I run:
$iter = 1; while( $iter <= 50 ){ echo "iteration no ". $iter ."\n"; $iter++; sleep( 1 ); }
Here is the command with which I run it:
$ drush php-script userstest.php
When I press CTRL + C, the drush command stops, but the PHP script continues to work. Here's what it looks like:
$ drush php-script userstest.php iteration no 1 iteration no 2 iteration no 3 $ iteration no 4 iteration no 5 iteration no 6 iteration no 7 ^C $ iteration no 8 iteration no 9 iteration no 10 iteration no 11 ^C $ iteration no 12 iteration no 13 iteration no 14 iteration no 15
And it continues until the PHP script is executed. How can i stop the script?
source share