Is it possible to sync only one file with lsyncd?

I'm really stumped - I spent almost two hours finding an answer to a ridiculously simple question: how can I keep two local files in sync on my mac permanently? I researched various stunts involving rsync, and then settled on using lsyncd.

But for life, I can’t understand how I can get lsyncdto synchronize two specific files. Is this supported in the API? The documentation was unclear whether it could be used rsyncin this way; I assume that lsyncdpasses CLI parameters that prevent this. My configuration is as follows:

sync = {
    default.rsync,
    source = "/Users/username/Downloads/test1.txt",
    target = "/Users/username/Downloads/test2.txt",
    rsync = {
        binary = "/usr/local/bin/rsync",
        archive = "true"
    }
}

He just says "don't sync anything." Help?

+4
1

lsynd

settings {
    logfile = "/var/log/lsyncd.log",
    statusFile = "/var/log/lsyncd-status.log",
    statusInterval = 20,
    nodaemon = true
}
sync {
   default.rsync,
   source="/srcdir/",
   target="/dstdir/",
   rsync = {
     archive = true,
     compress = true,
     whole_file = false,
     _extra = { "--include=asterisk", "--exclude=*" },
     verbose = true
   },
   delay=5,
   log=all,
}

lsyncd

root@localhost:/srcdir# ls
12  aster  asterisk

root@localhost:/dstdir# ls
asterisk
0

Source: https://habr.com/ru/post/1531541/


All Articles