gilestrolab / ethoscope

a platform from monitoring animal behaviour in real time from a raspberry pi
http://lab.gilest.ro/ethoscope/
GNU General Public License v3.0
17 stars 25 forks source link

Corrupted files when using rsync to sync db with external backup. #80

Closed pepelisu closed 7 years ago

pepelisu commented 7 years ago

I am not sure 100% this is a bug. When the system is running if you perform a rsync with the node to have an external backup of the data, sometimes you get a broken copy of the database. So if you run rethomics to have an idea of what is going on, it stops with an error: rsqlite_fetch "Database disk image is malformed" Do you have the same problem? For me it is not useful to have a backup of the database that is corrupted, could it be a rsync problem,though.

qgeissmann commented 7 years ago

do you use: https://github.com/gilestrolab/labscripts/blob/master/node/push_ethoscope_results.sh? It looks like you are modifying the file whilst fetching it. Ideally, you want to stop the backup daemon, rsync then restart it...

pepelisu commented 7 years ago

I did not stop the backup daemon, so that was the problem.

qgeissmann commented 7 years ago

we still nee to have a robust system I think, it should be the responsibility of ethoscope_backup.service to guaranty file integrity...

qgeissmann commented 7 years ago

closed via #82