Dino Geek, try to help you

How can I sync files between two computers using RSYNC?


RSync, or Remote Sync, is a free, generic command-line tool primarily used for copying and syncing files either locally or remotely in Linux systems. Essentially, it syncs files and directories from one location to another while minimizing data transfer using its delta-transfer algorithm. Differential data compression is used to decrease the amount of data sent over the network.

To sync files between two computers using RSYNC, at least one computer should run a Unix-based operating system like Linux or MacOS.

Let’s suppose we have two computers: Computer A, which has the files to be synced, and computer B that will be receiving the files. Here is a step-by-step guide:

Step 1: Install RSYNC, if it’s not already installed, on both computer A & B:

Debian-based distros (e.g., Ubuntu, Mint) use `sudo apt-get install rsync`
Red Hat-based distros (e.g., Fedora, CentOS) use `sudo yum install rsync`

Step 2: On computer B (the receiving computer), you should install and start an SSH server (if it’s not already running).

Debian-based distros use `sudo apt-get install openssh-server` to install and `sudo service ssh start` to start the server.
Red Hat-based distros use `sudo yum install openssh-server` to install and `sudo systemctl start sshd` to start the server.

Step 3: On computer A (the source), use the `rsync` command with appropriate flags to start the file sync. For instance:

`rsync -avz /path/to/source/directory/ user@computerB:/path/to/destination/directory/`

This command synchronizes files from the mentioned directory on computer A to the destination directory on computer B. The “-a” option enables archive mode to preserve file permissions, ownerships, and timestamps. The “-v” (verbose) option provides more detailed information about the ongoing operations. The “-z” (compress) option compresses the data before transferring, which is beneficial if you transfer over a slow network.

The above instructions and information are sourced from the official Rsync documentation (https://rsync.samba.org/documentation.html) as well as general Linux manuals and online resources like the Ubuntu Community Help Wiki (https://help.ubuntu.com/community/rsync) and TecMint (https://www.tecmint.com/use-rsync-synchronize-local-remote-directories/).

Keep in mind that you could automate this process by adding it to a cron job and using an SSH key pair for a password-less login. It’s also important to secure your RSYNC process, especially when syncing over the internet. Always ensure communication is done over a secure shell (SSH), use firewalls, and regularly audit your RSYNC logs.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use