sync
plantdb.commons.sync Link
This module provides a synchronization mechanism for PlantDB.
FSDBSync Link
FSDBSync(source, target)
Class for sync between two FSDB databases.
It checks for validity of both source and target by checking that:
- there is a marker file in the DB path root
- the DB is not busy by checking for the lock file in the DB path root.
It locks the two databases during the sync. The sync is done using rsync as a subprocess
Attributes:
Class constructor.
Parameters:
Source code in plantdb/commons/sync.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
lock Link
lock()
Lock the source and target DB before sync.
Source code in plantdb/commons/sync.py
89 90 91 92 93 94 95 |
|
sync Link
sync()
Sync the two DBs.
Source code in plantdb/commons/sync.py
97 98 99 100 101 |
|
unlock Link
unlock()
Unlock the source and target DB after sync.
Source code in plantdb/commons/sync.py
81 82 83 84 85 86 87 |
|