Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Backuping with tar #4249

Answered by nickva
Smixi asked this question in Q&A
Discussion options

Hello,

I'm using couchdb 2 and 3 inside containers with a volume to keep data.
I wanted to create and save backup, and what is currently done is executing a docker command to execute tar on the conf and data folder of couchdb.
docker exec dc-db tar -czhf - /opt/couchdb/data/ /opt/couchdb/etc/ > backup.tar
I found out that tar complains when writes operation are made during the tar creation:
tar: /opt/couchdb/data/shards/e0000000-ffffffff/mydb.1624868699.couch: file changed as we read it
In my understanding I read here that it should be fine because those a append-only log files. So using --warning=no-file-changed make tar ignore those warnings.

I just wanted to know if this a safe operation or if there is an interaction between tar and couchdb I am missing ? Should I find another way to backup data ?

You must be logged in to vote

@Smixi yes they are append-only files. If there was a write in progress (e.g. a document body being written) while while the backup as was made, that write won't appear in the backup. Any partially written data will be truncated and the file rewound to the last valid header block.

Replies: 1 comment

Comment options

@Smixi yes they are append-only files. If there was a write in progress (e.g. a document body being written) while while the backup as was made, that write won't appear in the backup. Any partially written data will be truncated and the file rewound to the last valid header block.

You must be logged in to vote
0 replies
Answer selected by Smixi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /