Portal Home > Knowledgebase > Articles Database > Rysnc while file still writing
Rysnc while file still writing
Posted by Dmitry85, 07-15-2008, 03:28 AM |
Hi All!
I wanted to make a cronjob with rsync, but I was wondering what happens when a user is uploading a file and the file is being created and at the same moment rsync synchronizes with another server.
Will the file be skip, partially be synced, ...?
Thanks in advance!
|
Posted by YUPAPA, 07-15-2008, 05:36 AM |
You have to know rsync does two parts, first it looks up the changes in the directory structure and second synchronize the files.
If he is uploading a file while rsync is looking for the changes in the directory structure, the file will be synchronized because it gets created already. However, the file may be synchronized partially if he has not finished uploading the whole file during the synchronization because rsync does not wait for the user to finish his upload and then do synchronization.
If the user starts his upload midway through the synchronization, rsync is not going to synchronize the file because it does not know the file is created while looking up the changes in the directory structure from the beginning.
|
Posted by Dmitry85, 07-15-2008, 06:06 AM |
Ok thanks for the answer! I know what todo know, make a script I can call myself and not use a cronjob
|
Add to Favourites Print this Article
Also Read