I have two Linux (Debian) machines "A" and "B" connected to each other wireless over the router.
On the machine "A" I run a script that generates every 5 seconds a new 1MB file in the specific folder (e.g. ~/files/). Files do not change after generation.
After the file is generated, it should be available on the machine "B" together with other files, that were generated previously.
What is the most efficient way (according to the CPU / network usage and transfer time), to do it?
scpin the script to copy the file after it was generated, so every file is copied individually.
rsyncto synchronize the folder contents between the machines.