Skip to content
Stuff I'm Up To
Go back

Lsyncd Maintain Permissions

Edit page

When synchronising files and folders with lsyncd I wanted to maintain the original owner and permissions.

To do this I added the rsync stanza to my /etc/lsyncd/lsyncd.conf.lua

settings {
  logfile = "/var/log/lsyncd/lsyncd.log",
  statusFile = "/var/log/lsyncd/lsyncd.status"
}

target_list = {
    "dvlaauction2.dh.bytemark.co.uk",
}

-- Docker

for _, server in ipairs(target_list) do

    sync {
        default.rsyncssh,
        source = "/srv/container-deployments",
        host = server,
        rsync = {
            _extra = {"-a"}
        },
        targetdir = "/srv/container-deployments";
    }

    sync {
        default.rsyncssh,
        source = "/srv/container-volumes",
        host = server,
        rsync = {
            _extra = {"-a"}
        },
        targetdir = "/srv/container-volumes";
    }

end

Edit page
Share this post:

Previous Post
WireGuard, OTP and ACL's
Next Post
WireGuard Gnome Extension