Free file sync auto sync10/22/2023 $ echo "This is line 2" > sample/source/file01.bin If we edit files in the source directory, lsyncd will automatically reflect it in the target directory: $ cat sample/source/file01.bin $ lsyncd -rsync /home/baeldung/sample/source /home/baeldung/sample/targetġ5:41:03 Normal: - Startup, daemonizing. The command above will copy/mirror the source directory recursively to the target directory: $ tree sample If the target directory is on a different machine: $ lsyncd -rsyncssh /home/baeldung/sample/source/ target-path/ Let’s set up a local lsync: $ lsyncd -rsync /home/baeldung/sample/source /home/baeldung/sample/target Our ~/sample/source directory will now sync to ~/sample/target directory every minute. The script removed the files in the target directory successfully. You can now select a different time for synchronization or make it a recurring task.Let’s delete a file ( ~/sample/source/file01.bin) from the source to see if it will also delete the same file from the target: $ rm sample/source/file01.bin
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |