문제

I'm trying to back up my db using a BASH script while having an application use it at the same time.

The application is not a heavy write application.

I've seen different solutions on SO, but want to confirm the correct way. I want users the ability to read at any time during the backup, writing is not a concern since I do all the writing (blog app).

Are there any dangers in corruption using:

sqlite3 /var/www/ghost/content/data/ghost.db <<EOF
.timeout 20000
.backup tmp.db
EOF
도움이 되었습니까?

해결책

The .backup command uses SQLite's backup API, which is designed for online backups.

As long as you do not do have broken hardware or software (which has nothing to with backups and would affect any writes), this will work fine.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top