| Please make sure that you have read this Turorial and that you have the latest rsync version installed on your webserver! Since this tutorial will switch between the backup server and your webserver, we will use names. Backup-Server is considered as Backup-Spot's server and the Webserver will be considered as your server where you want to send files from. 1. Make sure that rsync is actually installed on your Webserver by typing:
Rsync will return the version number if it's installed. If not, please referr to our "How to Install Rsync" Tutorial! 2. We will need an RSA access key so that we can access the Backup-Server from your Webserver. Please type the following on your backup server:
If your webserver returns a key we can go ahead and copy that, since we will need that key later. Please skip to step 4 if your webserver returns an access key. 3. Create an rsa access key using the keygen on your Webserver:
Now your Webserver will return this: Generating public/private rsa key pair.
4. Copy the RSA access key to our Backup-Server:
Make sure that the directory .ssh exists and copy the RSA access key into this file. If the file already contains a key just put 2 blank lines under it and paste your rsa access key into that file.
(Please make sure that you now have an keyfile on your Webserver called id_rsa.pub which is located in ~/.ssh/id_rsa.pub. Please also make sure that your key has been added to the authorized_keys file on our Backup-Server which is located in .ssh/authorized_keys) 5. Testing Rsync
Please replace YourBackup-ServerUsername with your ssh username on our Backup-Server, replace Backup-ServerIP with our Backup-Server IP and replace FOLDERNAME with the folder you want to place your files in. (ex.: MyBackups or /Backups/daily) This test will transfer all your files located in the /tmp folder from your Webserver. 6. Setting an Crontab on your Webserver
Copy and Paste into this file:
Replace /cpbackup with the folder you want to backup or point it to the place where cpanel creates its backups. This cronjob will run everyday. For more information about cronjobs see this article. Tip:
- Limit Bandwidth usage with --bwlimit from rsync to 1000 KB/s, this setting will decrease the impact on your customers, otherwise rsync will eat up all your bandwidth!
|
Powered by WHMCompleteSolution