Dino Geek, try to help you

How to use RSYNC with a configuration file?


Rsync is a powerful utility typically used for synchronizing files and directories between two different systems. More than just simple copying, Rsync also manages data in a way that only the segments of files that have been changed are transferred. You may opt to use Rsync with a configuration file to improve the process, especially when working with complex or routinely repeating operations. Here’s how you can do it.

To start with, you must install Rsync on your system. You can do this by using the command `sudo apt install rsync` on an Ubuntu terminal or its equivalent on other systems. Remember, you need to have administrative permissions to execute such operations (Digital Ocean, 2022).

An Rsync configuration file, often named ‘rsyncd.conf’, generally resides in the ‘/etc’ directory of your machine. This global configuration file enforces particular choices for Rsync daemon invocations, irrespective of the user’s command-line specifications. If you cannot locate the configuration file, you can create one using any text editor. On your terminal, type `sudo nano /etc/rsyncd.conf` (Linux Handbook, 2022).

Here is a general template configuration:

```
max connections = 2
log file = /var/log/rsync.log
timeout = 300

[data] comment = Data Folder path = /home/user/data read only = no list = yes uid = nobody gid = nobody auth users = user1 user2 secrets file = /etc/rsyncd.secrets
```
In the given template, ‘max connections’ limit the number of simultaneous connections, ‘log file’ specify where logs are stored, ‘timeout’ is the idle time after which a connection is severed. The bracketed term ‘[data]’ denotes a module, a particular directory shareable over the network. Within each module, you specify options like ‘path’ (physical location), ‘read only’ (whether to allow changes), ‘list’ (whether to list this share), ‘uid’ and ‘gid’ (user and group IDs for file access), ‘auth users’ (which users can access), and ‘secrets file’ (file containing passwords for these authenticated users) (Red Hat, 2023).

The ‘secrets’ file is a plain text file in format ‘username:password’, one user per line. You can create it using terminal by typing `sudo nano /etc/rsyncd.secrets`.

You then start the Rsync daemon by typing `sudo systemctl start rsyncd` on your terminal.

To use this Rsync setup from a client machine, you’ll use the command `rsync rsync://username@servername:/module`.

Remember to adjust the settings according to your particular requirements.

References:
- Digital Ocean. (2022). How To Use Rsync to Sync Local and Remote Directories on a VPS. https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps
- Linux Handbook. (2022). How to Backup and Restore Your Linux System with rsync. https://linuxhandbook.com/rsync-backup/
- Red Hat. (2023). System Administrator’s Guide. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/system_administrators\_guide/s1-rsync-variables


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