runServes.sh 1.1 KB

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. ps -aux|grep laravel-echo-server |grep -v grep|awk '{print $2}'|xargs kill
  3. ps -aux|grep artisan |grep -v grep|awk '{print $2}'|xargs kill
  4. nohup laravel-echo-server start >/dev/null 2>&1 &
  5. nohup php artisan queue:work --tries=2 --delay=2 >/dev/null 2>&1 &
  6. nohup php artisan queue:work --tries=2 --delay=2 >/dev/null 2>&1 &
  7. nohup php artisan queue:work --tries=2 --delay=2 >/dev/null 2>&1 &
  8. nohup php artisan queue:work --tries=2 --delay=2 >/dev/null 2>&1 &
  9. nohup php artisan queue:work --tries=2 --delay=2 >/dev/null 2>&1 &
  10. nohup php artisan queue:work --tries=2 --delay=2 >/dev/null 2>&1 &
  11. nohup php artisan queue:work --tries=2 --delay=2 >/dev/null 2>&1 &
  12. nohup php artisan queue:work --tries=2 --delay=2 >/dev/null 2>&1 &
  13. nohup php artisan queue:work --tries=2 --delay=2 >/dev/null 2>&1 &
  14. isExistStr=$(cat /etc/crontab|grep '* * * * * root cd /var/www_test/was && php artisan schedule:run >> /dev/null 2>&1')
  15. if [ ! -n "$isExistStr" ]; then
  16. echo -e '\n* * * * * root cd /var/www_test/was && php artisan schedule:run >> /dev/null 2>&1' >> /etc/crontab
  17. fi
  18. systemctl restart crond