Setup and Configure Lsyncd
I was looking for my options to sync files from Server A to Server B so I found Lsyncd
For the installation
sudo apt update
sudo apt install lsyncd
We need to create the configuration
sudo mkdir /etc/lsyncd /var/log/lsyncd
Now, create the following file
sudo nano /etc/lsyncd/lsyncd.conf.lua
And add the following configuration
settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd.status",
}
sync {
default.rsyncssh,
source = "/home/folder/tosync",
host = "[email protected]",
targetdir = "/home/folder/destination",
}
If you want to add a custom SSH port and prevent deletion you can do the following:
sync {
default.rsyncssh,
source = "/home/folder/tosync",
host = "[email protected]",
targetdir = "/home/folder/destination",
rsync = {
rsh = "ssh -p 99999", -- Specify the custom SSH port
},
delete = "false" -- Explicitly disable delete behavior
}
Related Articles
Dotnet Host FXR Does Not Exist
How to fix dotnet issue host FXR does not exist
Configure Wi-Fi on Ubuntu Server for Raspberry Pi Using Netplan
How to configure headless Wi-Fi networking on Ubuntu Server LTS (18.04, 20.04, 22.04, and 24.04) on a Raspberry Pi using Netplan and wpa_supplicant.
Parallels Ubuntu Emulation With Rosetta
Ubuntu x86_64 emulation not working with Parallels