1

I have some huge folders containing about 40000 files (and much, much more gitignored files like node_modules), and I want to rsync to a remote machine.

Currently, I use a simple script like run_rsync; fswatch -o $BASE_DIR | while read f; do run_rsync; done. But whenever a file changes, the rsync is triggered and I see it scanning the 40000 files to find out diffs, which consumes quite a bit of CPU and time.

Thus, I wonder, since fswatch knows which exact file(s) are changed, can rsync be aware of that, and only look at those few files and decide what to do with them. Is this possible?

Thanks!

5
  • Look into inotify (en.wikipedia.org/wiki/Inotify)
    – mtak
    Commented Mar 3, 2022 at 10:18
  • @mtak Thanks but I am not sure how this is to be integrated with rsync?
    – ch271828n
    Commented Mar 3, 2022 at 10:45
  • 1
    I was thinking maybe you could script something up that invokes rsync. I don't have time for a full and complete answer, hence why I posted it as a comment.
    – mtak
    Commented Mar 3, 2022 at 10:57
  • @ch271828n i have the similar problem, can you share which solution you ultimately went with? Commented Jun 14 at 8:07
  • @JacekKolasa Hi I did not find solutions iirc, and later use syncthing for many scenarios.
    – ch271828n
    Commented Jun 15 at 2:15

0

You must log in to answer this question.

Browse other questions tagged .