I have a script that simply does this:
cat /dev/ttyUSB0 > /home/pi/usb0_$(date +\%Y\%m\%d\%H\%M\%S).txt
It runs great, but I want to create a new file each day instead of one big file.
I thought about using crontab to do this, but I don't know how to get the first day's job to end before starting the next.