I have a program that is running on multiple machines and which is writing the results to
~/data/machine_name/, each time the results file exceeds 1MB the program moves on and write to a new file. (All machines have the same directory architecture).
I want to do an automatic backup of these files in case one of the machines fail. Knowing that the most recent accessed file is the one being written by the program, and hence, I would copy all the old files except this one. The next time the backup job fires, the most recent file omitted in the previous backup will be included and so on..
Right now I am using only a simple
scp command, which copies even the file being open by the remote machine.
Is there anyway to achieve this? a command line utility or a script for such a job?