Context :
I have a web server (my hosting provider is OVH).
I have a large folder with many files in many sub-directories (100k+ files).
I need to move this directory from one place to anuther on my hosting.
Following things I've read on internet and StackOverflow, I think the best way is to use the mv command.
Indeed, I just need to move the entire folder and all its content (kind of "renaming" it), and I believe that my destination path is on the same filesystem (but I can't ensure this).
So I plan to do this :
mv /home/www/folder1/myfolder /home/www/folder2/myfolder &
(I will use the "&" to execute the command in background without blocking)
To execute this command, the only way I have is to connect to my web hosting throught SFTP using the ssh command :
ssh username@address
Problems :
When I do that (I'm from Windows 10), I end with an error after a few minutes (I guess it is because of my inactivity) :
Connection reset by <IP_ADDRESS> port 22
My fear is that after I launch my mv command, as it should take a while, my ssh connection will be closed with this error...
To avoid the connection to be closed, I tried to create a ~/.ssh/config file on my client with the following content, as explained here :
Host *
ServerAliveInterval 240
I also did a chmod
chmod 600 ~/.ssh/config
Then, when I try to launch my ssh connection from Windows PowerShell, I have an error
Bad owner or permissions on C:\\Users\\antoi/.ssh/config
Then I tried from git bash, and I don't have this error, the ssh connection opens without errors.
BUT then I have another error after a few minutes and my connection is also closed :
attente de données expirée : déconnexion automatique
I don't have the message in english, but it should be something like that
expired data wait: automatic logout
Questions :
Can you tell me if my mv command will continue to execute on the server even if my SSH connection has been lost?
If the answer is NO, do you know how can I ensure to keep my ssh alive during the move operation ?
thank you in advance, I can't achieve my migration without these answers as it would be too dangerous if my data are corrupted or in an unknown state!