Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3340354
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:35:53+00:00 2026-05-18T00:35:53+00:00

We have an extensive existing codebase and we’ve added load-balanced servers with a single

  • 0

We have an extensive existing codebase and we’ve added load-balanced servers with a single master server to the equation now. There are various apps that contain models with uploaded files and images which all work fine… However, this raises the obvious problem of the rsync delay. Rsync is in the crontab and set to run every minute but this still means there’s a potential 59 second wait between content being created and it actually existing on the webservers.

What I would like, is to be able to register some kind of ‘post file changed’ handler that triggers rsync whenever a new file is uploaded. I can’t find anything of the sort though! Django has file upload handlers, but these appear to only deal with the actual upload stream, not the file as it is saved to the filesystem thereafter.

The best approach I can see is to create simple extensions to FileField, FieldFile, ImageField and ImageFieldFile as part of my project and hook into the save and delete methods in the FileField. Essentially, to create custom File and Image fields with this behaviour added. This isn’t massively complicated to do but it doesn’t seem like the most elegant solution to me. I’ll need to teach South about my new fields, update every model that is affected and then create hordes of south migrations (which I’m pretty sure will clash with some code we have pending).

I’m also looking into creating a custom Storage class for the project, but I’m nervous about this having far-reaching effects on other pieces of code.

I can’t believe no-one has come across this issue before, is there a canonical approach?

Thanks very much!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:35:54+00:00Added an answer on May 18, 2026 at 12:35 am

    If you want to tackle this problem from the server-side (eg. similar solution to rsync) and you’re running Linux, you might want to check out lsyncd:

    http://code.google.com/p/lsyncd/

    lsyncd uses inotify in the Linux kernel to watch directories and invoke an rsync as soon as files are modified. Fairly simple to drop in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an app with an extensive admin section. We got a little trigger
I have a PHP application that makes extensive use of Javascript on the client
I have a very large code base that contains extensive unit tests (using CppUnit).
In the company where I work we have major releases twice every year. Extensive
For statistical reasons, I want an extensive analysis from a dataset. I already have
I have an MSBuild script which compiles my existing solution but I'd like to
I have a fairly expensive array calculation (SpectralResponse) which I like to keep to
I have a table that looks something like this: word big expensive smart fast
I have a dataset in MySQL where using limit is already an expensive query,
I have a class in which looking up an instance is expensive, so instances

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.