Linux Server Files Backup SolutionsGoal: - Backup files in Ubuntu server to Centos serverPreparation: - Ubuntu Server (v11.10) - Centos Server(v6.0)Steps: 1. Install Rsync software into Ubuntu - Ubuntu default configuration files include rsync - Configure rsyncd.conf (Detailed configuration please reference relative materials)
- Above is rsyncd.conf- Set password for rsync- Rsyncd.pass’s format is – name:password, here I set backup:backup
- This step is really important, to change the permission of rsyncd.pass.2. Install Rsync software into Centos- Before install rsync, xinetd service should be installed first, because rsync is running based on xinetd.- Start xinetd service- Install rsync services.- Modify rsyncd.conf (Detailed configuration please reference relative materials)
- Here is my Centos rsyncd.conf- Set password- Format- name:password, here I use backupuser:123456.
- Change ownership of rsyncd.secrets (Of course you need to change it’s permission to 600 as Ubuntu)- Start rsync service.3. Start to backup- Put rsync service to start file so that each time when server is restarted, this service will start, too.- Make a file folder named “backup”(or any name you want) in Centos server to receive rsyncd files.- Now we can see, nothing in backup.- Rsync from Ubuntu to Centos, here I chose /home/carol this folder to be downloaded to Centos.
- Here is the files under /home/carol which I need to rsync to Centos- This is the process of rsync.
- Now we can see the same files under /home/carol of Ubuntu now have been downloaded to Centos backup file folder.4. Let backup be automatically.(Here we use cron service)- Start crond service- Set the time of backup, here I set every 21 hours 30 minutes, the backup command will be executed.