4 ms·
Maybe I'm crazy but I just have a cron job that does .backup during a time with little activity. My db is only 40GB or so and stored on an NVMe so it finishes q
by yread 3y ago
Maybe I'm crazy but I just have a cron job that does .backup during a time with little activity. My db is only 40GB or so and stored on an NVMe so it finishes quickly.
- hnben 3y agothis comments seems to say, that you could corrupt your copy, if you copy it while it is in use https://news.ycombinator.com/item?id=39838753 https://news.ycombinator.com/item?id=39838753
- simonw 3y agoThe ".backup" mechanism is safe - it's directly copying the file with "cp" that doesn't work. Here's how to use .backup: sqlite3 data.db ".backup 'backup.db'" You can also do this: sqlite3 data.db 'VACUUM INTO "backup.db";' That's slower, but results in a smaller backup file: https://www.sqlite.org/lang_vacuum.html https://www.sqlite.org/lang_vacuum.html
- hnben 3y agothanks!
- Nextgrid 3y agoNowadays you're considered crazy if you don't pay rent-seekers for every simple thing.