<div class="gmail_quote">On Thu, Jul 21, 2011 at 6:18 PM, Frederik Ramm <span dir="ltr"><<a href="mailto:frederik@remote.org">frederik@remote.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<div class="im"><br>
<br>
On 07/21/2011 10:07 AM, Andrew Ayre wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What protection is there in Osmosis to recover from this without missing<br>
any changes? If none, how are people solving this in their scripts?<br>
</blockquote>
<br></div>
I usually do this:<br>
<br>
* get latest changes, save in latest.osc<br>
* if a file named changes-to-apply.osc exists, merge latest.osc into that file; else rename latest.osc to changes-to-apply.osc<br>
* run osmosis to apply changes-to-apply.osc to my planet; remove changes-to-apply.osc if successful<br>
<br>
But it is possible that this is already over-cautious, and you could just as well run the --rri and --ac in one big step which would then ensure that the state.txt is only updated if the whole thing was successful. I'm not 100% sure about this though.<br>
</blockquote><div><br>I think it's over cautious. The --rri task won't update the state.txt until the complete() call on the pipeline has returned. If running within a single threaded pipeline the --ac task and destination pbf (if that's what you're using) task should be 100% complete before the state file gets updated.<br>
<br>You will however need a wrapper shell script to rename the new planet file to the original file name and this leaves a very small window for something to go wrong between the state.txt being updated and the file being renamed.<br>
<br>Brett<br><br></div></div>