[Sugar-devel] journal (0.82) backup

Martin Langhoff martin.langhoff at gmail.com
Thu Feb 11 10:36:15 EST 2010


On Thu, Feb 11, 2010 at 3:16 PM, Esteban Arias
<earias at plan.ceibal.edu.uy> wrote:
> I work with journal (0.82) backup. The idea is on jornal activity add button
> "backup" and "restore". and then run the script. as a subprosses.

It all depends on how you do it ;-)

As Daniel mentions, "backup" is safe, but "restore" can be tricky.
Here is what I propose you do for restore, so that it is safe. Ugly
pseudocode follows

 for each object in the backup:
    # next step might require an addition to journal code
    # to return  sha1sum of the file and of the canonical-json-encoded metadata
    # for a given journal entry
    if the object exists in the journal and is unchanged:
       continue
    use copy-to-journal (or its guts) to import it to the journal

cheers,


m
-- 
 martin.langhoff at gmail.com
 martin at laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff


More information about the Sugar-devel mailing list