#reading-list #sysadmin #tools

🔗 The screen utility in Ubuntu

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?

1# To create a new screen
2$ screen -S heavyESdataimport
4# Run the command
5$ php artisan app:import-heavy-data-to-elasticsearch --parallel
7# You can now close tehe screen and come back in a few hours
8# To reattach to the session, you can use:
9$ 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. ⚠️