Configuring Rsync backup Instruction

QuickWeb sells FTP/Rsycn backup storage space to our Dedicated, VPS and cPanel hosting clients which you can automate via cron job, contact sales(at)quickweb.co.nz if you want to order backup space starting from $5 per month for 5GB space.

Step 1

Log in to your server through SSH, telnet, or another shell access method.

Step 2

Create an RSA encryption key for use with the SSH transport. You may check if a key already exists by executing the following command:

# cat ~/.ssh/id_rsa.pub

If the file already exists, you may skip to step 3. Otherwise, create a key with the ssh-keygen utility:

# ssh-keygen -t rsa -N '' (note: these are two single quotes)

Step 3

Copy your RSA encryption key to our backup system. Please make sure the directory .ssh exists in your backup account prior to copy the file over.

# scp ~/.ssh/id_rsa.pub yourusername@ourserverip:.ssh/authorized_keys

If you receive this error message:
root@xxxxxxx [~]# scp ~/.ssh/id_rsa.pub xxxxxx@xxxxxxxxxx:.ssh/authorized_keys
xxxxxxxx@xxxxxxxxxxxxx.com's password:
scp: .ssh/authorized_keys: No such file or directory

That means that the .ssh directory does not exist and you should make the .ssh directory first.


Step 4

You may now test rsync by copying a small directory, such as /etc:  (note of our server's port at 2288)

# rsync -avz -e "ssh -p 2288" /etc yourusername@ourserverip:server1



If you receive any error messages, please contact technical by loging Helpdesk Ticket Otherwise, congratulations on configuring rsync to work with our system. You may now add rsync as a daily cron job, as outlined in step 5.

Step 5

If you are using Plesk Server Administrator, you can access crontab entries through the System menu under Services. Add a new task as root. Choose a Minute (0-59) and Hour (0-23) for the script to run each day. For Day of the Month, Month, and Day of the Week, just type a wildcard (*). Command will be in the format listed below.

If you are using cPanel/WHM, you'll need to add a crontab entry manually through the shell. As root, execute the following command (variations listed below):

#crontab -e
Add the lines suitable for your needs:
Back up entire server:
rsync -avz --exclude=/proc -e ssh / yourusername@ourserverip:server1

Back up home directories: 
rsync -avz -e ssh /home yourusername@ourserverip:server1

Back up specific users: 
rsync -avz -e ssh ~bob ~bill ~sarah yourusername@ourserverip:server1

Press ESC and type :wq to save.

That's it! You have successfully configured your backups.

  • 3 Utilisateurs l'ont trouvée utile
Cette réponse était-elle pertinente?