I have a small script which continuously logs data to my Raspi3 (kinda a data logger).I am writing all the collected data in to a plain txt file. My Pi logs data for a month or two continuously. So the file size increases (like 2 gb ). Now I am trying to plug in a USB in to a port of the Pi so that it copies the txt file automatically to the USB. How can i achieve this (also i want the data to get copied soon ) ?
I have tried automount, and I have added a line to the USB config file
KERNEL=="sd*", SUBSYSTEMS=="usb", ACTION=="add", RUN+="/home/pi/Testscript.sh"
This triggers the script when a USB is plugged and copies the data if the USB is empty as per the program in the script.But the copying process for huge file is slow.
Any suggestions or help ?