Push a command to run immune to hangup signals, and hopefully SSH clients crashing, while logging errors & output to a log file. Avoid re-executing if SSH timeouts occur, internet/VPN crash, etc.
Standard bin/magento example:
nohup php -f bin/magento catalog:images:resize > var/log/catalog_images_resize.log 2>&1&
For those who prefer n98-magerun2.phar
nohup n98-magerun2.phar catalog:images:resize > var/log/catalog_images_resize.log 2>&1&
Any other Magento 2.x bin/magento
can run as bg process with output/error logging, all while continuing to execute even after SSH session logout.
In particular the very long running process catalog:images:resize
on very large 100k+ catalogs.
nohup
bin_exec
params>
log.file 2>&1&
reference: