Lsyncd 2.2.2 所有权和权限问题(rsync、centos 7)

Lsyncd 2.2.2 所有权和权限问题(rsync、centos 7)

我遇到一个问题,文件被复制到远程服务器,但目标服务器上复制文件的所有者/组始终为“1002”。源的权限受到尊重并在目标上正确复制。我只是想不出一种方法来保留复制文件的所有者(和组)。

Lsyncd版本:2.2.2

我的设置如下:

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

sync {
    default.rsyncssh,
    source="/home",
    host="1*52.*.15",
    targetdir="/home/",
    delete = "running", -- prevents deletion of files on startup (ie when a server comes back online, don't delete files that are new on the backup)
    delay = 5, -- run every 5 seconds instead of default 20
    exclude = {
        "/home/backup",
    },
    rsync = {
        archive = true, -- use the archive flag in rsync
        perms = true, -- Keep the permissions
        owner = true, -- Keep the owner
        compress = true,
        acls = true,
            xattrs = true,
        _extra = {"-a"}, -- Sometimes permissions and owners isn't copied correctly so the _extra can be used for any flag in rsync
    }
}

相关内容