from: https://askubuntu.com/questions/8653/how-to-keep-processes-running-after-ending-ssh-session The best way is often the simplest.
nohup long-running-command &
It was made specifically for this, it even logs stdout to nohup.log
man nohup
If you want to "background" some already running tasks, then your best bet is to ctrl+z then run