2

What I'm trying to do:

I want to launch files to a .NET based website. Any time the dlls change, Windows recycles the web app. When I rsync files over the app can recycle several times because of the delay instead of the preferred single time. This brings the site out of commission for a longer period of time.

How I tried to solve it:

I attempted to remedy this by using the --delay-updates, which is supposed to stage all of the file changes in temporary files before changing them over. This appeared to be exactly what I wanted, however, giving the --delay-updates argument does not appear to behave as advertised. There is no discernable difference in the output (with -vv), and the end behavior is identical (the app recycles multiple times rather than once).

I don't want to run Cygwin on all of the production machines for stability reasons, otherwise I could rsync to a local staging directory, and then perform a local rsync, which would be fast enough to be "atomic".

I'm running Cygwin 1.7.17, with rsync 3.0.9.

I came across atomic-rsync (http://www.opensource.apple.com/source/rsync/rsync-40/rsync/support/atomic-rsync) which accomplishes this by rsyncing to a staging directory, renaming the existing directory, and then renaming the staging directory. Sadly this does not work in a Windows setting, because you cannot rename folders with running dll files in them (permission denied).

You are able to remove folders with running binaries, however this results in recycling the app every time, rather than just when there are updates to the dlls, which is worse.

Does anyone know how to either

  1. Verify that --delay-updates is actually working
  2. Accomplish my goal of updating all the files atomically (or rather, very very quickly)?

Thanks for the help.

4

1 回答 1

2

这很古老,但我最终发现 --delay-updates实际上按预期工作。由于其他因素,该应用程序似乎只是多次回收。

于 2013-04-01T20:39:41.867 回答