Backup Websites Using Rsync

WEBSERVER PROD (192.168.0.172)
——————————————–

$ sudo apt install -y rsync

WEBSERVER BACKUP (192.168.0.182)
———————————————–

$ sudo apt install -y rsync
$ rsync -e ssh -rlpgoDvc [email protected]:/home/agink.id/genose.agink.id/ /home/agink.id/genose.agink.id/
$ ssh-keygen 
Generating public/private rsa key pair.
Enter file in which to save the key (/home/agink.id/genose.agink.id/.ssh/id_rsa): 
/home/agink.id/genose.agink.id/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/agink.id/genose.agink.id/.ssh/id_rsa.
Your public key has been saved in /home/agink.id/genose.agink.id/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:wujyAGINK1kG/AGINK/Mcndi2w1X3pAGINKQsCHWkmrI [email protected]
The key's randomart image is:
+---[RSA 2048]----+
| ..o |
| . o |
| . . . |
| * . + o|
| o + + S + +|
| * . . . + .+|
| E * o.. oo=+ |
| . @ o o..oooo+. |
| .=.= . oo +=o.. |
+----[SHA256]-----+
$ ssh-copy-id -i .ssh/id_rsa [email protected]
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: ".ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Password:

Number of key(s) added: 1

Now try logging into the machine, with: "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.

Try SSH Login to webserver prod

$ ssh [email protected]

Automated sync

$ crontab -e
#
# RSYNC GENOSE FROM 192.168.0.172 EVERY 1 HOUR
0 * * * * rsync -e ssh -rlpgoDvc [email protected]:/home/agink.id/genose.agink.id/ /home/agink.id/genose.agink.id/ > /dev/null 2>&1