I have linux client and linux server. Both are Ubuntu 16.04.
On the client I generated .txt files almost every second, and I want to transfer them to the server, so my question is: what is the best solution for this purpose?
I did this script:
#!/bin/bash path="/home/path" while true do for entry in "$path"/*.txt do if [ -f "$entry" ] then scp "$entry" email@example.com:/home/4lkov/Desktop/scp && rm -f "$entry" else echo "No files"; fi done sleep 1 done
So, I'm using SCP is it reliable or is there best ways (rsync or similar)?
Also I'm using sleep 1.. probably there is some watchdog? (i.e
inotifywait -m /path -e create -e moved_to | )