Score:1

Use flock to back up sqlite?

cn flag

I want to back up an SQLite database file without making a local copy to avoid flash memory wear. I'd also like to avoid moving the partition to a snapshottable file system like LVM.

I figured I could just run flock database.db rsync ... but when I search online I cannot find this technique recommended anywhere, which is often a sign that it might not be a good idea.

Will this work or is there a better way?

Hack Saw avatar
tz flag
This ought to work. I'm a little surprised that rsync doesn't seem to lock files it's copying, or have that as an option.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.