File BackuP & Sync...

File BackuP & Sync...

Introduction

In today's fast-paced world, seamless file sharing and synchronization are essential for efficient collaboration between teams and remote work. However, transferring large files or entire directories can be time-consuming and inefficient, especially when the same files are frequently updated. In this article, we will explore how to use the powerful rsync command in Fedora to transfer files and directories between hosts on the same network while uploading only the changes made to the files. This incremental upload method significantly reduces data transfer and saves valuable time, making it an ideal solution for businesses and individuals seeking a more efficient file sharing process.

Prerequisites

Before we delve into the process, ensure that both the source and destination hosts are connected to the same network. Additionally, rsync should be installed on both machines.

To install rsync type:

$ sudo dnf install rsync        


Steps to Accomplish that

Step 1

Set up SSH Key-Based Authentication (Optional but Recommended):

To enhance security and streamline the transfer process, we highly recommend setting up SSH key-based authentication between the source and destination hosts. This will eliminate the need to enter a password each time you initiate a transfer.

On the source machine, generate an SSH key by running the following command in the terminal

$ ssh-keygen        

Press Enter to accept the default options for key generation. This will create the SSH keys in the ~/.ssh directory.

Next, copy the public key to the destination machine using the following command

ssh-copy-id user@destination_host_ip        

Replace user with the username on the destination machine and destination_host_ip with the 'IP address' or 'hostname' of the destination machine. You'll need to enter the password for the destination machine this time.


Step 2

Performing the Incremental Upload using Rsync

Now that the SSH key-based authentication is set up (if applicable), it's time to initiate the incremental file transfer using rsync.

Open a terminal on the source machine and use the following rsync command

rsync -avz --progress --delete /path/to/source/directory/ user@destination_host_ip:/path/to/destination/directory/        

Explanation of the rsync options used:

  • -a: Archive mode, which preserves permissions, ownership, timestamps, etc.
  • -v: Verbose mode, which shows the details of the transfer.
  • -z: Compresses data during transfer to reduce the amount of data sent over the network.
  • --progress: Displays the progress of the transfer.
  • --delete: Deletes any extraneous files from the destination directory that are not present in the source directory.

Replace /path/to/source/directory/ with the path to the directory you want to transfer files from and /path/to/destination/directory/ with the path to the directory where you want to upload the files on the destination machine.


Conclusion

In conclusion, the rsync command provides a powerful and efficient solution for transferring files and directories between hosts connected to the same network. By leveraging the incremental upload feature, rsync only transfers the changes made to files since the last synchronization, significantly reducing data transfer and saving valuable time. This method is particularly beneficial for businesses and individuals seeking streamlined collaboration and remote work processes.


Incorporating rsync into your file sharing workflow can enhance productivity and efficiency, making it a valuable addition to any Linux user's toolkit.


That's It for now feel free to reach out to me or explore more Write-Ups by me.

Thanks

- SK -

要查看或添加评论,请登录

SAKSHAM TRIVEDI的更多文章

  • DNF5... It's time to rethink the package management.

    DNF5... It's time to rethink the package management.

    Hello Folks, It's been a while since I have written any article. Well here I am now.

  • Simplifying SSH Connection: A Guide To Build Your Own Proxy Network

    Simplifying SSH Connection: A Guide To Build Your Own Proxy Network

    Establishing a secure SSH connection between Machine A and Machine F can be challenging, especially when intermediate…

  • Unleashing the Power of Linux: A Browser-Based Linux Experience

    Unleashing the Power of Linux: A Browser-Based Linux Experience

    To access Fedora Linux's graphical system in a browser using Apache Guacamole, you will need to set up Guacamole on a…

  • Gmail from Old Dog Terminal

    Gmail from Old Dog Terminal

    Mutt is used to send and receive email from your terminal, even if you're using hosted service such as Gmail. A…

  • Let's WhatsApp using Bash

    Let's WhatsApp using Bash

    S: AuthorAuthorIntroduction In today's fast-paced world, automation plays a crucial role in streamlining various tasks.…

    5 条评论
  • Ping... a message arrrived

    Ping... a message arrrived

    In this short tutorial, Here I am going to demonstrate chatting using ping command. For this first of all you need a…

    1 条评论
  • Containerized SSH Server

    Containerized SSH Server

    In this article I am going to demonstrate how to containerize SSH server so without any further explanation let's…

  • Mutiple Linux shells on a same system

    Mutiple Linux shells on a same system

    Recently I came across the question is there any possibility that multiple shells can be installed on the same system…

  • Jupyter Lab as a container

    Jupyter Lab as a container

    This article is focused on containerizing Jupyter Notebook inside the docker container with a fully-fledged develop…

  • Launching graphical application inside the docker container

    Launching graphical application inside the docker container

    Hello guys, In this article I am going to discuss how to launch the graphical application inside the docker. So, for…

社区洞察

其他会员也浏览了