-
Notifications
You must be signed in to change notification settings - Fork 1.1k
-
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 ?
Beta Was this translation helpful? Give feedback.
All reactions
@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
-
@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.
Beta Was this translation helpful? Give feedback.