Skip to content

What happens if... #24

Open
Open
@bertalanimre

Description

@bertalanimre

Hey Andreas,

Awesome trick you've done here. May I ask you what would happen in the following situation?

I wish to do a 2-way-file sync between two NFS servers. Now for this I could use only your watcher, but I would like to use something that is a bit more sophisticated than triggering scp commands. I was thinking about unison. Easy to use and easy to set up, and still does a pretty good job. However I want to trigger it with watcher and on file create events.

Now I want an upload folder to be watched and clone the files to the other backup server when they are uploaded. What happens with the following event line?

  • User starts uploading a 2 GB file
  • My webapplication starts receiving the file and creates it in the uploads folder
  • A file is created but obviously with not all the data yet.

My question is: Is watcher going to get triggered by this broken file as well or it is intelligent enough to wait until the upload is finished? If not, then....

  • User uploads the file
  • The webapp, when the upload is ready, can copy the file to a different folder
  • Watcher can watch that different folder and when the file is copied then it can trigger unison

What do you think? Is the first method working or am I forced to use the 2nd option?

Thanks in advance!

Bert

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions