Backup one directory to another, recursively
$rsync -r /path/of/source /path/to/backup
Now, that’s fine and dandy if you’re working on a local machine but if you’re moving stuff remotely you need some extra help from nohup. Nohup is a command that means “no hang up”, as in, even if your session is disconnected nohup will keep running. You’ll also need an ampersand to deal with any output.
Backup directory recursively, perserving permissions, and ignoring terminal disconnects.
$nohup rsync -ra /path/of/source /path/to/backup &
Using this command with sudo is a bit tricky, you can’t just throw a sudo infront of it and let it run. Instead you have to do two commands
#nohup rsync -ra /path/of/source /path/to/backup &