I use linux command line and I'm a beginner with it.
I've created two files,
the process is any output going to
test.log and i get it successfully the output in
I want to run a script automatically every 5 seconds and write only if there is any change with the
test.sh contains :
#!/bin/bash while [ true ] ; do echo "" date and Time >> test.log date +%x_r >> test.log lsusb >> test.log sleep 5; done
My question: Is there any way to run it automatically and only append the new change in the file with the new date? for example if anyone insert USB device into my machine it will append it with the new date into the existing log file it.