copy a file when the date of the source is newer than the destination
using xcopy and a loop i found this is a good way to make sure that changes in one file make their way across to another location using a windows batch file. this one loops every 5 seconds, i think you could run it without the 5 second timeout but it might cause excess cpu and drive usage.
BAT File
:loop
REM xcopy /D /Y
REM this will copy the file only if its changed from source to destination and check every 5 seconds for a change
xcopy file.txt file_backup.txt /D /Y
timeout /t 5
goto loop
Join me on Substack if you want me to send you a collection of the things i have done or found or read for the week. Or follow me on twitter if you prefer, i dont post much but i probably should!
When i was a little kid, I was really scared of the dark. But then I came to understand, dark just means the absence of photons in the visible wavelength -- 400 to 700 nanometers.
Then i thought, well, its really silly to be afraid of a lack of photons. Then i wasn't afraid of the dark anymore after that. Elon Musk