Simple Machines Community Forum

Customizing SMF => Building Your Community and other Forum Advice => Topic started by: Sono on September 01, 2021, 10:47:27 AM

Title: Does sql upload continue in SSH if I close terminal window?
Post by: Sono on September 01, 2021, 10:47:27 AM
My webhost's cpanel offers a terminal app to manage things in SSH on my space. I noticed that when I start importing a database in the terminal with the command: "mysql", close the terminal window, come back again, and type "top" into the newly opened terminal window, I can see the "mysql" command still running. Is it possible to start the import and close the borwser and wait like this for the process to finish, or in case the browser is closed, after a while the process will shut itself off due to my inactivity? When I do the same with Putty, that is disconnect while the "msql" process running, the disconnection terminates the import process as well. In Cpanel, this seems to be different.
Title: Re: Does sql upload continue in SSH if I close terminal window?
Post by: Arantor on September 01, 2021, 01:00:58 PM
Normally you want to use the `screen` command to be able to run it in the background, though unfortunately talking you through how to do this is a bit out of the scope of what we can do here.

I'm sure there's a few good tutorials online for it, though, but the idea is that you log in, run screen, then run the mysql command line client in that screen and when you disconnect, you're disconnecting from the server but the 'screen' is still running and you can reconnect to it later.

cPanel however is very much a law unto itself as to what it does.
Title: Re: Does sql upload continue in SSH if I close terminal window?
Post by: Sono on September 01, 2021, 04:54:44 PM
But until the "top" command is listing 'mysql' as running, theoretically it is working on the import, isn't it?
Title: Re: Does sql upload continue in SSH if I close terminal window?
Post by: vbgamer45 on September 01, 2021, 04:59:50 PM
You can check the mysql process list which would should you inside mysql itself.
Title: Re: Does sql upload continue in SSH if I close terminal window?
Post by: Arantor on September 01, 2021, 06:15:47 PM
Quote from: Sono on September 01, 2021, 04:54:44 PMBut until the "top" command is listing 'mysql' as running, theoretically it is working on the import, isn't it?

Depending on your server infrastructure, that might be the server itself, not the client.