S
S
Sergey2016-06-07 13:13:01
linux
Sergey, 2016-06-07 13:13:01

Are there ways, besides passing a list from find, to force rsync to only sync files that are more than a minute old?

There is rsync synchronization of certain directories on two servers, software periodically writes to this folder on the source, other software takes files on the destination server, files are not saved on the source server (according to the technical specifications, so to speak). Actually, I suddenly ran into a problem, due to the fact that the input conditions were given to me incorrectly, it turns out that the software does not generate a file somewhere at home and then puts it in a folder for uploading, but immediately writes there, as a result of rsync grabs a file in which more are written changes, transfers to another server, deletes the source. What it gives: a broken file on the destination server, a falling task of writing to a file.
In general, find -mmin solves the problem, but I wonder if there are any other ways to solve this? man rsync seems to have studied, there was nothing similar.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Olohtonov, 2016-06-07
@Kamikaze

Solved a similar problem. The most correct way is to require the creation of flags indicating that the file has finished being created. You can write inside the md5 file. And on your side, you will check whether the corresponding flag file exists for the file and whether its md5 is correct.
If this is not possible, then the correct way would be to read the md5 files with some pause (if the files are small, the size is better for large ones), and if md5 has not changed since the previous reading, then consider the file ready for download and copy it.

D
devian3000, 2016-06-07
@devian3000

Look towards
lsyncd. (add-on to rsync)
It synchronizes the list of changes with a delay, I think in this case it can help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question