Sample Header Ad - 728x90

lsyncd -- one way synchronisation but for the whole folder

1 vote
1 answer
2147 views
I have two folders ~/A and ~/B. With some content. I write an lsyncd configuration file ~/.config/lsyncd/lsyncd.conf: # NOTE: Use only absolute path names # NOTE: check "man rsync" for parameters inside "rsync{}". # Global settings settings { logfile = "/home/ziga/.config/lsyncd/lsyncd.log", statusFile = "/home/ziga/.config/lsyncd/lsyncd-status.log", statusInterval = 5 } # Synchronisation A ⟶ B sync { default.rsync, source = "/home/ziga/A", target = "/home/ziga/B", delete = true, rsync = { binary = "/usr/bin/rsync", executability = true, existing = false, } } And I start lsyncd like this: lsyncd -nodaemon ~/.config/lsyncd/lsyncd.conf > **Note:** Parameter -nodemon is there only to give me more information > in the terminal where I run the above command. Immediately after the command is executed, synchronisation takes place and content of folder ~/A is transfered to the folder ~/B. This is okay. According to my configuration file I would expect that if I delete a file in ~/B, it will not be deleted from ~/A which is also the case! And this is a wanted behaviour - I want to prevent accidental deletion of content in folder ~/A. But at this point I would also expect that lsyncd will detect that folder ~/B is missing a just deleted file and will sync the folders again by copying the missing file from ~/A to ~/B like it does immediately when it is started! **But this does not happen.** How can this be done?
Asked by 71GA (1296 rep)
Oct 28, 2021, 03:26 PM
Last activity: Nov 1, 2021, 07:40 PM