Commit 96523eb7 by Giang Tran

Add rsync backup guide

parent e3900aa9
# About this guide
This guide is for backing file to remote server by using rsync + ssh
# Setup remote server for backup
## Generate SSH key
```
$ ssh-keygen -f ~/.ssh/id_rsa -q -P ""
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLVDBIpdpfePg/a6h8au1HTKPPrg8wuTrjdh0QFVPpTI4KHctf6/FGg1NOgM++hrDlbrDVStKn/b3Mu65//tuvY5SG9sR4vrINCSQF++a+YRTGU6Sn4ltKpyj3usHERvBndtFXoDxsYKRCtPfgm1BGTBpoSl2A7lrwnmVSg+u11FOa1xSZ393aaBFDSeX8GlJf1SojWYIAbE25Xe3z5L232vZ5acC2PJkvKctzvUttJCP91gbNe5FSwDolE44diYbNYqEtvq2Jt8x45YzgFSVKf6ffnPwnUDwhtvc2f317TKx9l2Eq4aWqXTOMiPFA5ZRM/CF0IJCqeXG6s+qVfRjB root@cloudads
```
Copy this key to your clipboard and login to your destination server.
Place this SSH key into your ~/.ssh/authorized_keys file:
If your SSH folder does not exist, create it manually:
```
mkdir ~/.ssh
chmod 0700 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 0644 ~/.ssh/authorized_keys
```
## Run rsync to copy file
```
$ rsync -avz --ignore-existing -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /root/bigfile.txt ventura@192.168.1.2:/
```
There are many options of rsync, so please read document to set options suit you.
# Reference links
https://www.digitalocean.com/community/tutorials/how-to-copy-files-with-rsync-over-ssh
http://linoxide.com/how-tos/rsync-copy/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment