Step 4: Automate the Backup Processīy default, rsync does not have a built-in automation process for backing up and syncing files without user intervention. This is proof that the file transfer worked. You can create your own source and destination directories in different paths as you deem fit.įrom the output of running the command, the files were transferred successfully to the remote server. The directory to be backed up on the local or source server is the /home/jumpcloud/data/ folder and the destination backup directory is the /home/user/backup folder. $ sudo rsync -avz -e ssh /home/jumpcloud/data/ :/home/user/backup In our example, the full command will be: SOURCE_DIRECTORYis the directory to be backed up.ĭESTINATION_IPis the IP address of the remote or destination server. $ sudo rsync -avz -e ssh SOURCE_DIRECTORY DESTINATION_IP::backup To save and sync files remotely, rsync takes the following syntax: We already have a directory in our home folder containing a few files that need to be backed up. To test the file backup process, log back into the source server. Now let’s put our setup to test and see if we can successfully back up data from the source server to the remote server. $ sudo firewall-cmd –add-service=rsyncd –permanent Next, configure the firewall to allow rsync service: If SELinux is enabled, configure the Boolean setting as follows: The path directive specifies the path to the destination backup directory while the hosts allow directive indicates the IP address of the source server. Then paste the following lines in the configuration file. To do so, create a configuration file as follows: Next, you need to configure rsync to allow remote connections from the source or local server. Once installed, confirm it is installed with the following: To install rsync on CentOS 8, use the DNF package manager as follows: In addition to installing rsync on the source or local server, we also need to install it on the destination server or cloud server. The output below confirms that we have rsync installed: Step 2: Install and Configure Rsync on the Destination Server To confirm that rsync is installed, run the command: Once installed, start and enable the rsync service. In this example, we will install rsync on the local server (Ubuntu 20.04) as follows: To start off, ensure that rsync is installed. Step 1: Install Rsync on the Local Server
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |