x86_64-alpine-db-sidecar/db-restore.py
2020-08-17 22:31:12 +08:00

12 lines
277 B
Python

import sys, sqlite3
def progress(status, remaining, total):
print(f'Copied {total-remaining} of {total} pages...')
con = sqlite3.connect('sys.argv[2]')
bck = sqlite3.connect('sys.argv[1]')
with bck:
con.backup(bck, pages=1, progress=progress)
bck.close()
con.close()