no method to rebuild status file

Issue #12 resolved
Anonymous created an issue

During a shutdown while the client was running the status file was corrupted. There's no method I can tell to regenerate that file and thus the client will not run without wiping and re-fetching all of the files again.

Comments (2)

  1. Martin von Löwis repo owner

    It's actually possible to recreate the status file by filling out a pep381client.Synchronization instance, and then calling save on it.You need to set homedir and last_completed, the latter to a date that is certainly before the last complete mirroring run (e.g. int(time.time())-3600*24*10).

  2. Rick Harding

    Thanks, I got it updated and running with this in case anyone else hits this. It was from an rsync from another server where I wasn't sure how long ago it'd had a successful run so hopefully going back 30 days will work out.

    import pep381client as c
    from time import time
    s = c.Synchronization()
    s.homedir = "/data/mypi/cache"
    s.last_completed = int(time()) - 3600 * 24 * 30 = c.sqlite.SqliteStorage('/data/mypi/cache/files')
  3. Log in to comment