summaryrefslogtreecommitdiff
path: root/src/backend/recoverdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/recoverdb.py')
-rw-r--r--src/backend/recoverdb.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/backend/recoverdb.py b/src/backend/recoverdb.py
new file mode 100644
index 0000000..c429340
--- /dev/null
+++ b/src/backend/recoverdb.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python3
+
+import animation
+import os
+import sisyphus.getfs
+import sisyphus.syncDatabase
+
+@animation.wait('recovering databases')
+def cliExec():
+ if os.path.exists(sisyphus.getfs.remotePackagesCsv):
+ os.remove(sisyphus.getfs.remotePackagesCsv)
+ if os.path.exists(sisyphus.getfs.remoteDescriptionsCsv):
+ os.remove(sisyphus.getfs.remoteDescriptionsCsv)
+ if os.path.exists(sisyphus.getfs.localPackagesCsv):
+ os.remove(sisyphus.getfs.localPackagesCsv)
+ if os.path.exists(sisyphus.getfs.localDatabase):
+ os.remove(sisyphus.getfs.localDatabase)
+
+ sisyphus.syncDatabase.remoteTable()
+ sisyphus.syncDatabase.localTable()