On Thu, Jul 21, 2011 at 6:18 PM, Frederik Ramm <[email protected]> wrote:
> Hi, > > > On 07/21/2011 10:07 AM, Andrew Ayre wrote: > >> What protection is there in Osmosis to recover from this without missing >> any changes? If none, how are people solving this in their scripts? >> > > I usually do this: > > * get latest changes, save in latest.osc > * if a file named changes-to-apply.osc exists, merge latest.osc into that > file; else rename latest.osc to changes-to-apply.osc > * run osmosis to apply changes-to-apply.osc to my planet; remove > changes-to-apply.osc if successful > > 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. > 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. 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. Brett
_______________________________________________ dev mailing list [email protected] http://lists.openstreetmap.org/listinfo/dev

