We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Did you know that you can use the ubuntu CLI app called
screen
to run a long running script on your server without worrying about cancelling it due to an SSH disconnect?# To create a new screen $ screen -S heavyESdataimport # Run the command $ php artisan app:import-heavy-data-to-elasticsearch --parallel # You can now close tehe screen and come back in a few hours # To reattach to the session, you can use: $ screen -r heavyESdataimport
One very important thing to note however:
Please do not use 'screen' as a manager for long running processes such as PHP or Nodejs scripts. Use PHP-FPM, PM2 or some other service.
I've seen this being done in production for a fairly large startup and 🤢
continue reading on twitter.com
⚠️ This post links to an external website. ⚠️
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.