nohup rsync --partial --progress -avvvz -e "ssh -i /root/.ssh/id_rsa" ./backups [email protected]:~/ &
Here, the directory ./backups from current server is being transferred over to the remote server at 188.8.131.52. The ssh authentication normally requires a password. We have already setup a key for the server. The public key corresponding to id_rsa has been appended to .ssh/authorized_keys on remote server, so it works without asking for a password.
The command immediately returns to the shell.
If you wish to see the progress, exec:
tail -f nohup.out
In this way you can see the progress but still avoid the connection terminating and stopping the transfer. Even if disconnected this kind of command allows resume at the failed position.
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.