Does anyone have ever tried rsync'ing sqlite database?
Is it possible to access the data while it gets syncronised?
|
feedback
|
|
I would consider this dangerous. The SQLite database also has journal files that need to be preserved. If you
It is highly likely that you will experience corruption. Use the SQLite Online Backup API instead. | ||||
|
feedback
|
|
No, sqlite databases aren't constantly coherent by default. However, a search on "sqlite copy file" has found a page on doing online backups with SQLite, which I suspect will cover all the issues you may have. | |||
|
feedback
|
|
The previous answers are correct. But if you make 100% sure there is only read activity on your database you can safely take any kind copy of the database file. I've done this in a production application for ages without issues (cp, tar, rsync, scp, sftp). The database file is set read only at os level (chmod a-w) and database write attempts give an error
while all selects work normally. Then, of course, this approach may or may not be feasible regarding you application. The same approach can be used to prevent unauthorized writes like SQL injection on a web application. | |||
|
feedback
|